Jun
7

Fix Fatal error: Allowed memory size of 8388608 bytes exhausted

I was installing xdebug a few days back to one of the production servers when I encountered this beautiful error message:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 143 bytes) in /usr/share/pear/PEAR/PackageFile/v2/Validator.php on line 1608 Allowed memory size of 8388608 bytes exhausted (tried to allocate 64 bytes)

So my instinct tells me to look inside the php.ini file and find for this line:

memory_limit = 12M

The server’s php.ini file is already set to 256M so I should go look for something else. Luckily, I found this tip from www.agileapproach.com.

Open the file /usr/share/pear/pearcmd.php and add this right after the < ?php line:

@ini_set('memory_limit', '16M');

That should fix the “Fatal error: Allowed memory size” error. I can now resume installing xdebug without any errors.

The reason why editing the php.ini will not fix the issue is because PECL/PEAR does not use the PHP settings, so the PEAR settings needs to be adjusted.

Hope this helps.

Related Posts

3 Comments to “Fix Fatal error: Allowed memory size of 8388608 bytes exhausted”

  • alok October 13, 2009 at 7:56 am

    thank you so much!!!! i spent hours trying to get this fixed!

  • Tapan Kumar Thapa October 15, 2011 at 6:25 pm

    Thanks it helped me….

  • amjad April 20, 2012 at 7:25 pm

    nice info

Post comment

CommentLuv Enabled

Powered by 1and1.comDomain Registrations starting at $9.98* Earn with Your BlogAdvertise @ PinoyTux

Search PinoyTux

Subscribe to Email Feeds

Enter Email Address:

Blog Lounge

Popular Posts

Recent Posts

Recent Comments

Site Stats