Subject: PHP running out of memory. How can I fix that?
To: NetBSD Users Mailing List <>
From: Gilles Gravier <>
List: netbsd-users
Date: 05/25/2007 12:45:38

So my web server (Apache 1.3) calls PHP scripts... and things start 
going wrong when PHP runs out of memory :

[Fri May 25 10:58:09 2007] [error] PHP Fatal error:  Allowed memory size 
of 33554432 bytes exhausted (tried to allocate 1440001 bytes) in 
/usr/pkg/share/swisscenter/base/image.php on line 402

Any suggestion as to how to fix that?

Putting ulimit statements somewhere? But where? I've tried in the 
rc.d/apache scripts... that doesn't work.

I've tried replacing /usr/pkg/bin/php with a wrapper script, but to no 
effect (in any case, Apache loads a library, if I remmeber well)...

So I'm out of ideas and open for suggestions... any available? :)

Thanks in advance,
/*Gilles Gravier*/ *=* ** <> 
*=* **
ICQ : *77488526* 
<> * || *MSN 
Messenger : <>*
*Skype : ggravier <callto://ggravier>* || *Y! : ggravier 
<> || AOL : gillesgravier 
PGP Key ID : *0x8DE6D026* 
My Last Known Position / Ma Derniere Position Connue 
"Chastity is its own punishment." (/Solomon Short/) [/David Gerrold/]
"De toutes les aberrations sexuelles, la chasteté est la plus 
aberrante." [Anatole France]