See how to easily check and change the PHP version on your host using cPanel.
Like this video tutorial?
Subscribe to BlogAid on YouTube
Follow BlogAid on Facebook
Transcript for the regular tutorial is below the video
Transcript
It’s critically important that you keep the PHP version on your site current for security and performance reasons, and to keep current on compatibility with WordPress, themes, and plugins.
Hi, I’m MaAnna with BlogAid and in this quick tutorial, I’ll show you how to access your PHP level on a host with cPanel.
If you do not have access to your hosting control panel, or yours looks very different from what is shown in this tutorial, please check your host’s Knowledge Base articles or ask your host for help.
Check for Updated Tutorials
Site tech changes all the time. Be sure to check the description above or below this video for any updates to the tutorials and for any links mentioned.
Prep for the Change
Before making any changes to your site, take a full backup first.
If you are using any PHP version lower than 7.0, you may want to check your site’s PHP 7 compatibility first. However, I’ve found it faster to simply make the switch and then poke around the site.
If anything goes whack, you can always change back to your original PHP version, and no permanent harm will have been done to your site (in 99.99% of cases).
Multiple Sites
If you have more than one site in your cPanel, all of them will be affected by this PHP change. And that’s not good.
It’s also not good for security or performance to have multiple sites under the same cPanel account. You may want to consider getting what’s called a reseller account so all sites can be on their own cPanel. Contact me if you need help changing to that type of account.
cPanel PHP Check
What you will see in this tutorial will apply to most all modern hosts that use cPanel.
This is the latest cPanel interface as of the recording of this tutorial. If yours looks different, your host may have a custom build over cPanel, or may have their own control panel. See their tutorials or ask them for help.
In the search field at the top, type php.
Find and click the tool for Select PHP Version.
If you don’t see this tool, or you are on a reseller or VPS hosting account, you may need to use the MultiPHP Manager instead. We’ll cover that tool in a bit.
If you do have the Select PHP Version tool then click it.
At the top you can see the PHP version you are currently using.
Change PHP Level
Click the drop-down to select a new PHP version.
Then click the Set as current button.
Check Database Settings
Scroll down and check that mysqlnd and nd_mysqli are checked on.
If you have a database connection issue after changing your PHP version, the settings in this area are likely the culprit.
Check PHP Options
Scroll back up to the top.
On the right, click Switch to PHP options.
Ensure that error reporting is set to E_ALL
For the rest of the settings, you may need to check with your host for their recommendations.
Following are my general recommendations for shared hosting accounts.
And be careful, as more is not better with these, else you could get yourself into hosting account resource overages.
Shared Hosting Recommendations
Max_execution_time 3000
Max_input_time 60
Max_input_vars 1000
Memory_limit 256M
Post_max_size 512M
Upload_max_filesize 16M
Check Your Site
Be sure to clear all cache – see this post on how to Delete Cache Everywhere to purge your browser, local caching plugin, and Cloudflare.
Then use a fresh incognito window to check your site.
Poke around all over and pay particular attention to site functions that are provided by plugins and ensure they work.
Then, if you are using Cloudflare, check your site again in 10 hours or next day, as it could take that long to fully purge deeply.
If all is well, then you are finished.
If you encounter any problems with your site, make note of them, and switch your PHP version back to what it was originally until you can find a fix.
Change PHP via the MultiPHP Manager
Click the tool.
You can see the current PHP version for your site.
If any site on the account is set to inherit the global PHP version for the hosting account, you may need to ask your host for help making this change if it is for the primary domain on the account, as it will affect all of the sites that are inheriting that version.
Click the checkbox next to the site you want change.
Over on the right, click the PHP Version drop down and select the new PHP level.
Then click the Apply button.
You should see the level change for that site in the list below.
For the other PHP option settings, return to the main cPanel.
Type php in the search field.
And click the MultiPHP INI Editor tool.
Select the site from the drop down.
And here you have many of the same settings you saw previously.
But, you will need to check with your host for the defaults, as this is likely on a reseller or VPS account and they may be very different than the defaults for shared hosting.
VPS Hosting Recommendations
NOTE: The master settings are in the MultiPHP INI Editor.
But, they can be overridden in the following files:
- .htaccess
- Php.ini
- .user.ini
Ensure that all are set the same.
Max_execution_time 3000
Max_input_time 100
Max_input_vars 10000
Memory_limit 512M
Post_max_size 512M
Upload_max_filesize 16M
Need More Help?
I hope you’ve enjoyed this quick tutorial on how to check and change your PHP version.
Want someone to watch over your shoulder as you make these changes? Contact me for a live session.
MaAnna-thanks for this easy to follow tutorial! I changed from 7.0 to 7.2 and received an error about MySQL extension missing. I changed it back to 7.0 and all is well with my site. But is that something I can fix or something A2 has to fix? Or maybe I’m ok at 7 for now?
Sounds like a server-side thing to me, Tipper. I’d contact the host.
You can stay at 7.0 until the end of the year, but I wouldn’t wait past mid Dec.
I don’t want to change until we get past the WP update.
I am using Cloudways PHP hosting and running a PHP 7.0 server. I wanted to upgrade the server to the latest version, which is PHP 7.3, and upgrade my WP site to latest 5.x version as well. However, after upgrade the versions, when i try to access the site, i am getting 500 error. Why is that?
500 is a server error. You’ll want to check with your host about it.