We also have a helpful guide on Setting your PHP Settings in Command Line.
How to view your current PHP settingsTo view your current PHP settings, create a PHPinfo page. If you’re not sure how to do this, please see How can I view my PHP settings using a PHPinfo page ? The steps in updating the values listed in your PHP info page depend on how PHP is setup on your particular server. In general, PHP runs on our servers as either:
- Apache module
- CGI Module
Server API: ApacheIf your server runs PHP as an “Apache module“, you can change your PHP settings via a .htaccess file. A .htaccess file is a configuration file you can create and use to change many server settings, including PHP settings. The basic syntax to use in your .htaccess file for updating PHP settings is:
php_value Directive valueFor example, if you wanted to change the max_input_time from 60 seconds to 120 seconds, add the following to your .htaccess file:
php_value max_input_time 120After making this change, refresh your PHP info page, and you should see the changes. If you receive a 500 error, please double check the syntax you used as you may have made a misspelling. If you don’t have a .htaccess file, you can simply create a new file named .htaccess. As the .htaccess file begins with a dot (.), it is considered a hidden file. If you are using the cPanel’s File Manager, please be sure to select the option toÂ Show Hidden Files (dotfiles), otherwise you will not be able to see your .htaccess file. If you do not see this prompt when opening your File Manager, click the, “reset all interface settings” link at the bottom of your cPanel to reset your File Manager settings.
Server API: CGI
;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 30 max_input_time = 60 memory_limit = 256M upload_max_filesize = 10MTo change the max_input_time from 30 seconds to 120, for example, simply change 30 to 120 and save the file. Refresh your PHP info page, and you should see the changes.
Increasing PHP memory in the php.iniA common issue when using free open source software or other PHP intensive programs is the “exhausted memory” error. If you have a PHP memory error on your site, you can increase the memory limit PHP uses for the scripts. To learn how to change the memory limit in your php.ini, please see the following link.
Modifying the PHP.INI fileHere is a quick step-by-step tutorial on editing the PHP.INI file.
- Login to the cPanel.
- Find the File Manager in File section of the Cpanel. Review our tutorial on using the Code Editor within the File manager if you’re looking on information how to use it.
- Navigate to the directory where you will either save or edit the PHP.INI file and then select the file and use the Code Editor. To open the file, you can click on it to select the file and then click on the Code Editor icon in the menu bar of the File Manager. You can also right-click with your mouse and select Code Editor from the menu that appears.
- Edit the section of the PHP.INI that you wish to change.
- Click on SAVE CHANGES in the top right hand corner in order to save your modifications or additions to the file.