Find your website PHP version with just 1 line of code

There are situations when you want to know what PHP version you are using on your website. Pretty sure you will be able to simply ask your host about this, but what if you want to get this information in just a few seconds?

There are times when your control panel will show you a PHP version but your website will actually using a different one – this happens because of some server miss-configuration but it can be fixed really fast, just as you web hosting provider if this is the case.

You don’t have to be a web developer to check your PHP version, in fact you can do this with just 1 simple line of code and here is what you have to do step by step:

  • create a file (example info.php) in your local computer;
  • open the file with any text editor and add to it the following line of code:
<? phpinfo(); ?>
  • save the file and upload it to your website document root;
  • access your website in browser like: domain.com/info.php

and that’s pretty much it! Now you will find what PHP version you are using plus a lot more other details about your PHP installation.

NOTE: It’s not recommended to keep that file available for public, you should simple have it for you in case you are troubleshooting something and after that simply remove it from your website.

If you encounter any issues following this mini-tutorial, let us know in a comment bellow, we will try to help you out!

Total Comments (1)

  1. Gregory January 22, 2020

Reply