Websites frequently use PHP scripting language for content and applications. PHP is an acronym for Hypertext Preprocessor. PHP is typically embedded in the HTML code and processed on the server. The most common CMSs, or Content Management Systems, such as WordPress, run on this technology.
PHP is frequently offered along with MySQL, which is a database management system, and it is extremely simple and straightforward for new programmers.
Your hosting account has PHP installed by default unless you’re on a Virtual Private Server or VPS plan. You don’t need any manual installation; you can use it directly on your sites.
Usually, the last version of PHP is the best one to use from a security, performance, and features perspective. However, there are some applications that are older and are not compatible with the latest version of PHP. For this reason, you may need to make them run on an older version of PHP.
The prerequisites are you need a cPanel username and password, a web hosting account that supports PHP and cPanel, and a domain name (for instance, www.example.com).
Changing Your PHP Version
Firstly, go into your account on cPanel and navigate to the Software Tab, in which you will find the Select PHP Version tool.
Here, you can select the PHP version that your website requires. Once you’ve selected the version you need, you can press Set as current. Below, you will see the modules that are available for this precise PHP version that you’re running at the moment. In order for your website to work without any issues, you can disable or enable them as you need.
At the top, you’ll find the Options tab where the PHP settings can be changed, such as upload_max_filesize, max_execution_time, memory_limit, and so on. Below, we will go over the options that you will be tweaking in most cases.
upload_max_size – To adjust the maximum upload file size that should be supported on your site, you can adjust this value. For example, you might need to tweak this value if you are uploading a large MySQL database.
post_max_size – This value is the most common in web forms, and it shows the maximum value that can be accepted by GET and POST variables.
max_execution_time – This value can be set to a higher limit if that is something that you need, and it shows the maximum execution time that a script should run.
display_errors – If you change this value to ‘On’ since it is set on ‘Off’ by default, your browser will show errors on PHP scripts.
That is all it takes to change the PHP version used on any site you choose. The best thing about cPanel is that PHP customization is made very easy. We hope that our guide will assist you in adjusting the settings according to your needs.