0

In the process of migrating some websites on Apache/PHP/MySQL from a Windows Server host to a Linux host, I restored them to the file system, configured virtual hosts and all of the plumbing, connected to the MySQL database, and went to log into one. After a short while it threw this error message:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1228800 bytes) 

This should be a piece of cake I thought and went to change memory_limit in /etc/php.ini to 256M and bring httpd down then up. Not so fast! PHPInfo is still showing the old value:

memory_limit 128M 128M 

and the app is still throwing the exactly same error as above. I double-checked that it PHPInfo is also showing the same file as the one I edited:

Configuration File (php.ini) Path /etc Loaded Configuration File /etc/php.ini Scan this dir for additional .ini files /etc/php.d 

Searched /etc for memory_limit and found it in 3x files: php.ini, php.ini.rpmnew and php-fpm.d/www.conf. I believe that by default Linux now runs php-fpm, so I changed the value in all the 3x of them to 256, 257, and 258M, just to be able to tell, but still PHPInfo is showing 128M after httpd stopped and restarted.

I even went into the actual web app and changed their defines for memory limit to no avail.

Where is the memory limit hiding?

1 Answer 1

1

There may be a copy hiding in the web app's /etc folder. However, if it is php-fpm, likely it simply hasn't yet revisited the init file. Have you tried restarting the web service?

2
  • Your guess is correct: after a full OS reboot, the value under /etc/php-fpm.d/web.conf came in force, contrary to any docs that I was able to find. Would love to read one where that is described. It is insane that httpd stop/start does not affect the value, but I will leave it at that. Commented Jan 1 at 2:48
  • 1
    "httpd stop/start does not affect the value" - it does if you are using mod_php. But you appear to be using php-fpm. You need to stop/start php-fpm. Commented Jan 8 at 10:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.