[PHP] ini_set('memory_limit', '16M')
Hi, On one script (pulling large amount of data from mysql) I'm getting error: "Fatal error: Allowed memory size of 16777216 bytes exhausted..." I put on the beginning of the page ini_set('memory_limit', '64M'); but I'm still getting the same error message?!? Any idea? Thanks for any help. -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ini_set('memory_limit', '16M')
Hi, > On one script (pulling large amount of data from mysql) I'm getting error: > "Fatal error: Allowed memory size of 16777216 bytes exhausted..." > I put on the beginning of the page > ini_set('memory_limit', '64M'); > but I'm still getting the same error message?!? > ini_set() returns the old value, so it might work if you assign the return value: $x = ini_set('memory_limit', '64M'); George -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ini_set('memory_limit', '16M')
afan pasalic wrote: Hi, On one script (pulling large amount of data from mysql) I'm getting error: "Fatal error: Allowed memory size of 16777216 bytes exhausted..." I put on the beginning of the page ini_set('memory_limit', '64M'); but I'm still getting the same error message?!? Any idea? Thanks for any help. -afan if this is for your receiving upload script, you will find that PHP does not parse/use any of your script until the upload is completed with your web server and then passed off to PHP. So, the only way to change the amount is via the php.ini/.htaccess/vhosts entry If you are using apache and can use .htaccess files, I would suggest that method. Next I would configure my vhosts if all else fails, I would change the setting in the php.ini file -- Jim Lucas "Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them." Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ini_set('memory_limit', '16M')
On Nov 28, 2007 4:05 PM, George Pitcher <[EMAIL PROTECTED]> wrote: > Hi, > > > On one script (pulling large amount of data from mysql) I'm getting error: > > "Fatal error: Allowed memory size of 16777216 bytes exhausted..." > > I put on the beginning of the page > > ini_set('memory_limit', '64M'); > > but I'm still getting the same error message?!? > > > > ini_set() returns the old value, so it might work if you assign the return > value: > > $x = ini_set('memory_limit', '64M'); > > George > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > http://php.he.net/manual/en/ini.core.php#ini.memory-limit Prior to PHP 5.2.1, in order to use this directive it had to be enabled at compile time by using -enable-memory-limit in the configure line. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php