Php – Settings on php.ini ignored

apache-2.2PHPphp.ini

I can't get my server to obey the settings from php.ini (I'm trying to change memory_limit and upload_max_filesize). As far as I can tell, I'm editing the correct file. phpinfo() gives:

Loaded Configuration File   /etc/php.ini

The file permission is 644. There are also some extra .ini files on /etc/php.d, but none include any of the keys I'm trying to change. No matter what I do, phpinfo reports the default values on both "Local" and "Master" columns.

I also scanned my Apache config files, but found nothing related to PHP (besides loading the PHP module). The only way I was able to change those settings was by adding some php_value lines to my .htaccess.

Is there something obvious I'm missing?

This is a virtual server, and I can perform root commands with sudo. I'm running Apache 2.1.3 and PHP 5.3.3. System info (from uname -a) is:

 Linux sesctbapp01 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 EST 2012 x86_64

Best Answer

write a file in your webserver called test.php:

<? phpinfo(); ?>

Then open it in your browser

there is a section

Directive   Local Value Master Value

where you see the values, of all variables and where they are set: Local Value means, set in .htaccess or inside the php-script with ini_set()

also try http://php.net/manual/de/function.ini-get-all.php to find out the source of the content of your variables.

i once had a stupid error, where i tried to set upload_max_filesize to 200M: i wrote "200MB" in php.ini, but it must be just "200M" php interprets the incorrect value "200MB" as 0. Maybe some of this helps