To change PHP parameters on your VPS, follow the steps below:
- Login to your cPanel VPS
- Go to File Manager under Files section.
- Navigate to public_html directory.
- Click on New File button at the top of the page.
- Enter php.ini as the New File Name and click Create New File.
- Select the php.ini file.
- Click on the Edit button at the top of the page and in the pop-up box which is prompted after.
In the php.ini file, provide the PHP parameters are shown in the examples below.
max_execution_time = 30 register_globals = Off magic_quotes_gpc = On safe_mode = Off
If you are using LiteSpeed web server instead of Apache. You need to add the PHP parameters similarly in the .htaccess file as LiteSpeed don’t read php.ini file. But there is a small change in the syntax. Here is an example:
php_value upload_max_filesize 10M php_value memory_limit 256M php_value max_execution_time 180 php_value max_input_time 180
After the values are added, you can check if the changes are reflected using a phpinfo page.
We hope you have found this tutorial useful on how to change the PHP parameters on your VPS server.
Thanks for reading and leave your questions below to keep the conversation going.