Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
Did you restart apache after you made the changes? – Zypher Jul 11 '12 at 19:45
Yes, I tried both restarting and just "reloading". – bfavaretto Jul 11 '12 at 19:52
Do the following and post back what it finds: find / -name php.ini – drumkiller Jul 12 '12 at 13:19
The output was just /etc/php.ini. – bfavaretto Jul 12 '12 at 15:09
It can either be that those values are overwritten by the starter script (if using php-fpm) using the -d option or that the PHP script is setting it's own limit within the PHP files. Beside that, no idea. One thing to keep in mind is that not all PHP modes support setting values via htqccess - just to mention that. – MaddinXx Oct 2 '13 at 5:26

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 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

share|improve this answer
Thanks, but this problem is still a mystery to me. It like if some other ini file is overriding mine, but I can't find any. Also, although phpinfo() reports my ini file as "Loaded Configuration File", the values under "Master" are always the defaults. The only way I can override them is from .htaccess, while I really wanted to define all my settings from php.ini... – bfavaretto Sep 17 '12 at 2:43
maybe there is a bad typo in the php.ini so it is ignored completely and all default php values are used instead. can you post your php.ini somewhere? – rubo77 Sep 17 '12 at 2:49
Hm, I haven't thought of that! Here is my php.ini: – bfavaretto Sep 17 '12 at 2:55
can i see the output of your phpinfo() somewhere? – rubo77 Sep 17 '12 at 17:30
and try moving the php.ini file somewhere else and restart apache. if you see an error, you will know, that apache tries to use that file, if there is no error, you should look somewhere else. normally php.ini is at /etc/php5/apache2/php.ini – rubo77 Sep 17 '12 at 17:34

Run php -i in the terminal and it will flag if you have any syntax errors in your php.ini. Such errors make Apache to not parse (ignore) directives quietly.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.