Custom php.ini file not working in VPS hosting Custom php.ini file not working in VPS hosting apache apache

Custom php.ini file not working in VPS hosting


First thought is to check your phpinfo() output for the value listed in the "Loaded Configuration File" setting and make sure that it matches the file you've been editing.


You can't just litter PHP.ini files around and expect PHP to load them. If it's not been told to look for one in that cgi-bin directory, the file will just get ignored.

Check the phpinfo() output - the first section will tell you exactly what .ini files were located/parsed, and their location. e.g. on my home server:

Configuration File (php.ini) Path   /etc/php5/apache2Loaded Configuration File   /etc/php5/apache2/php.iniScan this dir for additional .ini files     /etc/php5/apache2/conf.dAdditional .ini files parsed    /etc/php5/apache2/conf.d/curl.ini, /etc/php5/apache2/conf.d/gmp.ini, /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini 

if your cgi-bin .ini file isn't listed, then PHP is NOT looking in that directory.


I know this is old but figured I'd share my experience. I tried adding a php.ini file to the /cgi-bin folder as I read was suggested, that didn't appear to work. My solution was to SSH onto the server and make a change to the real php.ini file and then restarting the server.