Sunday, 14 March 2010

Fatal error installing PEAR Net_URL2 PHP extension

I was trying to install Net_URL2-0.3.1 via PEAR on a windows dev box but this kept on failing.
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 2
576 bytes) in C:\00_tools\AppServ259\php5\PEAR\Archive\Tar.php on line 611
I first changed the memory limit in php.ini but this did not work.

Finally, I released the memory was imposed by PEAR itself.

The solution is to modify pearcmd.php to explicitely set the memory limit.

Adding this line fixes the problem:

@ini_set('memory_limit',"32M");

Hope this helps.