Linux : PHP Warning: Unable to allocate memory for pool

By | June 2, 2014

Found this error in your Web site Apache error logs?

PHP Warning:  require_once(): Unable to allocate memory for pool.

This is actually caused by APC (Alternative PHP Cache). The allocated memory limit for APC has been reached and no additional PHP script can be cached anymore.

The symptoms on your Web site for such error would end up with a blank page.

To resolve this matter, I would recommend increasing the memory limit and lowering the timeouts as well.

Edit the APC config :

/etc/php.d/apc.ini

Increase the memory limit :

apc.shm_size=

(default is usually 64M, increase it to 128M)

Lower the TTLs :

apc.ttl=
apc.user_ttl=
apc.gc_ttl=

(default is usually 7200 seconds, lower it down to 3200 seconds)

Then restart the Apache Web server daemon :

service httpd restart