Web Dev

PHP error: Unable to allocate memory for pool

If you are getting below error

Warning: Unable to allocate memory for pool

then you may think it is PHP memory issue and update memory size in php.in file..

But the error occurs due to Alternative PHP Cache (APC). The APC directives need to be updated in this case.

To resolve the issue, open apc.ini or php.ini file in editor and follow below steps:

1) Update mktemp-style file_mask to pass to the mmap module correctly

apc.mmap_file_mask=/tmp/apc.xxxxxx

2) Update share memory value

apc.shm_size=128M

The value can be adjusted as per the requirement.

3) Adjust the number of seconds a cache entry is allowed to idle in a slot

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

The value can be adjusted as per the requirement.

4) Save the file and restart the Apache service.

Abhijit Sandhan

Love to Automate, Blog, Travel, Hike & spread Knowledge!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button