Photos:

China pictures processed

 
0%
 
2008.02.11 @09:31 

PECL and PEAR memory problem

PECL and PEAR memory problem

if you had like me this kind of problem when trying to install or uninstall a package with PECL or PEAR:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 16 bytes) in /usr/share/php/PEAR/Registry.php on line 1012

Than your version of php is older than 5.2.0, either because you didnt reinstall it for a while or because you're under ubuntu for example.

After this version they figured out that the memory limit by default in PHP is 8M, which is very low, so probably you have all figured out how to increase this value in the php.ini !

Yeah but pecl and pear are not using the php.ini sadly, not even the "cli" version that you have under ubuntu or other installation. It is just PLAIN DEFAULT values.

So the trick is to edit the pecl script which is locate here under ubuntu (at least 6.10) :

/usr/bin/pecl

edit the last line where << exec $PHP ... >> is written and add << -d memory_limit="-1" >> just after $PHP, this should look like :

exec $PHP -d memory_limit="-1" -C -n -q $INCARG -d output_buffering=1 -d safe_mode=0 $INCDIR/peclcmd.php "$@"
 

"No Comments"
Post a Comment
Comments have been deactivated thanx to screwers.