How to change PHP settings?


 

Important

You must make certain that you are not using the nativeversion.The settings of this version cannot be changed with the instructions below, you must first change the php version itself.

We also suggest checking if your public_html or any folders within it have any php.ini files, and if the website's .htaccess files have no lines starting with suPHP_ConfigPath. We recommend to rename any php.ini files to php.ini.bacukup, and to comment any suPHP_ConfigPath lines out by inserting the # symbol at the very front.

Changing PHP settings

 

There are two ways to change PHP settings:

 

One. The first and the easiest one is to change the settings through the website's cPanel control panel.Connect to your cPanel control panel andselect  then in the window that opens, press the Show PHP Settings button:

 

and then change the value you need changed:

 

 

Dont forget to press Apply to save the settings.

 

Two.This way Is a little more complex but allows for more PHP settings to be modified, that do not show up in the cPanel control panel, but allows to modify settings which you couldn't change in selector.

 

All php.ini settings are changed by editing the /etc/cl.php.d/alt-php$version$/zzz_php.ini file, $version$ is the number of your selected version. The file can be reached by any program that can work with the SFTP protocol, such as  WinSCP. If the file does not exist, it must be created.

Example 1. Lets say your website uses 5.3 and you need to change the value of the parameter allow_url_fopen which is globally set to Off. Then you would open the /etc/cl.php.d/alt-php53/zzz_php.inifile and add this line:

allow_url_fopen = On

Example 2. Lets say your website uses 5.4 and you need to activate the functions exec() and system() which are globally Off. In that case you would open thefile /etc/cl.php.d/alt-php54/zzz_php.iniand add this line:

suhosin.executor.func.blacklist = shell_exec,popen,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,proc_terminate,ini_alter,dl,symlink,pclose,proc_get_status,leak,pcntl_exec,show_source

Notification

If settings won't change make sure php.ini file doesn't exist in the main web catalog, e.g. /home/user/public_html/php.ini
Settings should be activated afterwards.

Tags: changem, how, php, settings, to
Chuck Norris has counted to infinity. Twice.