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.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

VZPP shows MySQL and httpd down?

If you have cPanel, this is due to incompatiblity between the VPS system and cPanel. The VPS...

What name servers do I use for my domains on my VPS?

Please register your private name servers using the tutorial that applies to your domain...

I would like to change the OS (operating system) of my VPS. How can I do that?

If you would like to change the OS of your VPS, you need to take a complete backup of any of your...

Which Linux flavor do you recommend for my VPS and why?

We recommend enterprise level operating systems such as CentOS. This is because it has the most...

I have a shared/reseller account. Why should I upgrade to VPS?

VPS is a virtual private server that gives you a separate process environment not shared by other...