PHP is the language of WordPress. It’s how all the plugins, themes, and WordPress itself are written. Each new version of PHP brings out new features, speed improvements, bug fixes, and security patches. And every new version of WordPress makes better use of the functionality of PHP. The development of WordPress and the development of PHP happen side by side. One reinforces the other.
However, while most people automatically update WordPress from the dashboard, or do it automatically via cPanel settings, the PHP version remains a lot more static. This is for several reasons – the most important one being stability. New versions of PHP often deprecate older function calls, and this can break some older themes and plugins.
The server dictates the version of PHP that WordPress uses. WordPress cannot upgrade or downgrade the PHP version by itself. You need to change it manually via cPanel. A lot of hosts will upgrade PHP for you only when absolutely necessary.
As of this writing, the latest (and greatest) version of PHP is 7.0.x. It’s much faster and uses up far fewer resources than its predecessor. But many hosts still haven’t migrated all their customer automatically to 7.0, and are still using the older 5.6 instead. Some managed WordPress hosting services quickly migrate their customers to the latest version of PHP.
Here are two ways to check which version of PHP WordPress is running on.
Method 1: Check via cPanel
This is the safer way to check the PHP version. It’s also easier and doesn’t expose your site to any attacks if you’re careless. So I recommend this approach if you have access to your cPanel.
Log into the NameHero cPanel, and click the “Select PHP Version” icon under “Software” as shown here:
This will bring you to the page where you can see which PHP version you have installed on your server:
As you can see in the screenshot, the version here is 7.0. Note that this isn’t a “full” version number. The interface here cuts it off to the first point release. Also, this is where you can change your PHP version as well as install and remove some modules. This panel is your dashboard for PHP.
As I said, it’s the best way to get information on what PHP version you’re running. However, if you don’t have access to cPanel, or want more detailed info on PHP, then method 2 is what you want.
Method 2: Using a PHP File
To do this, open a new file on your desktop and give it the name “phpversion.php”. Paste the following text into it:
<?php phpinfo(); ?>
Now FTP into your site and upload this file to the root directory of your WordPress installation.
Now view the file in your browser by typing in the URL like this:
Replace [yourwordpressaddress] with the address of your WordPress blog. If all goes well, you should see an output like this:
This words because of the “phpinfo()” WordPress function which gives very detailed information about your PHP environment. Note that even the version number here is more specific – 7.0.32 instead of just 7.0. If you scroll down the page, it gives you a wealth of data on everything related to PHP.
Important: Delete the File Afterward
For security reasons, it’s best to not let someone else access this file. So after you’re done, make sure that you delete it. Hackers can find all sorts of ways to get into your website if they find out you’re running an older version of PHP for instance!
Bottom Line: If you’re looking for extremely detailed information about PHP, then Method 2 is your best bet. If you just need the general version, then Method 1 is safer, and easier to implement.
I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!
Leave a Reply