Client Login

How do I make changes to PHP settings on my VPS/server?

Here we are discussing runtime settings of PHP, not adding/removing PHP modules.

1) If you have phpsuexec setup through cPanel (i.e. you have cPanel on your VPS/server and you have phpseuxec active), then you can place a php.ini file by copying it from /usr/local/lib/php.ini to the folder where the PHP script is being executed over the web. You can then edit php.ini there to make changes to it.

To make server level changes, you can edit /usr/local/lib/php.ini

2) If you have PHP as an Apache module, then you can:

a) Edit server wide settings by editing php.ini (in cPanel at /usr/local/lib/php.ini) and make sure to restart Apache.

b) If you want to make account level changes only (e.g. only want to enable/disable register_globals in one account), you can refer to this:

http://www.php.net/manual/en/ini.php
http://www.php.net/manual/en/configuration.changes.php

Please read those links for all the possible changes you can do in PHP. For example to disable register_globals for one account when PHP is running as an Apache module, you will place this directive:

php_flag register_globals off

in the .htaccess file in the public_html folder of that account. Again, please read those links for all types of settings you can set in .htaccess.



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read