Most of the time when you get web hosting and install WordPress on it, everything works by default out of the box. But sometimes, you might try doing things a little differently – perhaps install software that isn’t standardized, for example. Or you may need to increase certain in-built PHP limits like the memory allocation, or the maximum allowing file size for media uploads.
These can all be modified in the PHP options section of cPanel. From here, you can do the following:
- Change the PHP version
- Enable or disable PHP modules
- Modify the PHP configuration parameters
All of these can also be done via the command line if you’re on a VPS server. But it’s much cleaner to do it via the GUI, where you can simply enable or disable checkboxes as necessary and choose the right values from a dropdown box. In this tutorial, I’ll show you how to configure PHP options from cPanel for NameHero.
Enabling and Disabling PHP Modules
Log into your cPanel account for the domain whose PHP version you want to change. Remember that you can have multiple domains on a shared hosting service, and you can have different versions of PHP for individual folders corresponding to different websites.
So make sure you don’t just log into cPanel, but the right cPanel on NameHero. Other hosts may allow you to modify the PHP version for individual folders, but that’s not how it’s done on NameHero. Once inside, search for “PHP Version”, and choose the appropriate icon as shown below:
This will bring you to a screen with the following components:
- A dropdown box to select the PHP version
- A list of modules you can enable/disable
For each PHP version in the dropdown box, you can configure the PHP modules you want to have. By default, the most important packages for your current version are already enabled. If you want to see which modules your current version of WordPress requires, you can try this handy WP-CLI tool.
Here’s a screenshot of the modules you can enable/disable.
From here, you can also modify the current PHP version of your website. Also keep in mind that if you select the “native” option, you won’t be able to enable or disable any extensions. This is the version that comes in-built when Apache is installed, and so doesn’t allow for any changes. It shouldn’t matter because you can select the version you want as a separate item in the drop-down box even if there’s a “native” version present.
Switching PHP Configuration Parameters
From this same screen, you can then click the top right box that says “Switch to PHP Options”.
This brings up a list of PHP parameters – that normally reside in the PHP.ini file, that we (luckily) don’t have to modify ourselves. There’s a long list of useful options here.
For example, if you want to change the size limit of the files that you’re allowed to upload to WordPress via the media uploader, you can change that here as shown in this screenshot:
You can also do stuff like modify the amount of memory that PHP is allowed to use for this domain. This is a tricky option to handle, and normally you shouldn’t need to modify it unless you have good reasons for doing so.
You don’t need to save your changes once you enable or disable options in these screens. The changes are made automatically as soon as you modify something then and there. There’ll be a little visual indicator and a green pop up on the top right of the window that tells you whether the operation was successful, so there’s plenty of feedback.
But be careful with this screen! Make changes here only if you know what you’re doing. Luckily, reversing them is as easy and making the modification in the first place.
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