At ThisWebHost you may be aware that we run CloudLinux on all of our shared servers. What you may not be aware of is that in addition to helping us manage server resources, CloudLinux also ships with something called “PHP selector” that gives you a great deal of control over PHP in your account via cPanel.
Choose which version of PHP you want to use
When you think of hosting and servers, you may traditionally think that you’re forced to use whatever PHP version your hosting provider has installed on your server. Fortunately that’s no longer the case! With CloudLinux you’re able to choose from a wide range of PHP versions in just a few clicks.
From within cPanel, click on the “Select PHP Version” option under the ‘Software’ category:
You’ll now see something like this on the following page:
What this means is that the current PHP version for the account (and all websites running under that account) is set to the servers native version – PHP 5.6. What if this isn’t a version you want to use? Easy, simply click on the drop-down box and choose the version that you’d like to use:
In the above picture we’ve used the drop-down box to change from the native PHP version (5.6) to PHP 7.1 – something much newer. But we haven’t finalised the change yet. Underneath the PHP version we now see a list of available PHP extensions. Before we confirm that we want to use PHP 7.1 we can ensure that the PHP extensions we may want to use are enabled by checking the appropriate checkboxes. By default we have already pre-checked some of the most common PHP extensions for typical usage.
When you’re ready to switch to PHP 7.1, click on the ‘Set as current’ button next to the PHP version:
We’ll know that the change has taken affect when we see the new version listed as the “Current PHP version”:
Congratulations, you’ve just changed the version of PHP for your hosting account!
Changing PHP settings
So now we’ve changed the version of PHP on our account, what if we’d like to make some more changes? One of the most common requests we receive is customers who would like to increase the PHP size upload limit (upload_max_filesize). CloudLinux also lets you adjust some of these settings from within cPanel, too!
On the same page as before (“Select PHP version” within cPanel), simply click on the link towards the top right of the page (“Switch to PHP options”):
On the following page you’ll be presented with a list of PHP settings that you are able to change. For security reasons, not every PHP setting is available for you to modify (this is shared hosting after all), but you should have access to the most common settings that can benefit you – such as the PHP upload size limit that we discussed before.
To change any of these values, simply click on the grey value to the right of the setting and the value will then become adjustable. For example, here we have clicked on the “2M” next to the upload_max_filesize setting. We want to change the value to 16M, so we’ve used the drop-down box that has appeared to select the value “16M”.
Once you’re happy with the new setting, simply click the “Apply” button next to your new value(s). The new setting(s) will be instantly applied to the version of PHP running on your account.
CloudLinux is a fantastic tool to give you more control over the PHP environment of your website(s). In just a few clicks you can change PHP version, PHP extensions or PHP settings to suit your requirements. No longer are you restricted to the version(s) and setting(s) that your hosting provider have set by default.
We hope that this article was useful to you. As always, if you have any questions, comments or concerns then please do get in touch with us!