How to Change The Value of a PHP Setting

You can apply custom PHP settings on a per-folder basis using a local php.ini file. For example, you need register_globals set to Off in a directory. For this purpose you should log in your cPanel and go to the File Manager. There navigate to the directory where you’d like this setting applied. In this directory create a file php.ini containing:

register_globals = off

Naturally, if you’d like register_globals turned on you should specify:

register_globals = on

How to Change The Value of a PHP Setting
However, there are two exceptions:
– some important PHP limits cannot be changed, for example memory_limit and max_execution_timeout. Setting different values than the administratively assigned will endanger the overall shared server performance.
– PHP might be compiled as an Apache module. In this case try using a .htaccess file containing:

php_value name value

For example, if you’d like to turn off register_globals you have to specify:

php_value register_globals off

Please note that you cannot change global PHP settings with a local php.ini file if you are using PHP 5.1. Also there are certain limits that are globally defined and cannot be changed per account.

Or other you can use PHP function ini_set to set PHP config values, example Like:


You might like:

Leave a Reply