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

CentOS system.

Summary: changed memory_limit in master and local php.ini and yet no change in the local value for a particular virtual host.

Trying to improve performance, I set the memory_limit to 1024M in /etc/php.ini

phpinfo() shows Master and Local values for other virtual hosts on the server as 1024M. Changing the value in /etc/php.ini changes all values, except one.

One site is stuck with a local value of 256M.

I thought I found the problem: there is a php.ini file (which I didn't know about) in that site's root, and it had

memory_limit = 256M

I changed it to 1024M. Problem solved? No. And now I don't know where to look. Obviously, I've restarted apache (/etc/init.d/httpd restart), and that usually does the trick.

I also turned off APC cache, though I don't think it would cache ini files.

And finally, I tried adding this to the virtual host in httpd.conf:

php_value memory_limit 536870912

(yes, that would be 512MB) And that had no effect whatsoever.

What else could be the problem?


share|improve this question
up vote 1 down vote accepted

I found the answer. There was a hidden .htaccess file in the site root that was overriding all other values.

It had the line:

php_value memory_limit 256M

I changed it to:

php_value memory_limit 1024M

No need to restart apache, the memory limit went up to 1024M immediately.

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.