Re: PHP: Fatal error: Allowed memory exhausted
| From: | Afan Pasalic | Date: | Thu, 30 Mar 2006 23:18:37 +0000 |
| Subject: | Re: PHP: Fatal error: Allowed memory exhausted | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232962@lists.php.net to get a copy of this message | ||
Means not bad - if it's REALLY well controlled. But, to risky.
:)
Chris wrote:
afan@afan.net wrote:ok, then. how "smart" is to do something like this? what's a bad side?Your memory will runaway and your script could potentially take over the server and slow everything down. Just like any other script could.Actually you need to set it to -1. http://www.php.net/manual/en/ini.core.phpafan@afan.net wrote:Hi, I'm working on the script that has to read csv file (51 column an a little bit over 3000 rows) with products and store the info in DB. Script works fine while I tested on csv files up to 200 records. And, when I tried to upload REAL data I got this. PHP: Fatal error: Allowed memory size of 8388608 bytes exhausted ... On google I found as a solution to put ini_set("memory_limit","12M"); on the top of the script, except allowed memory size wasn't 8m then 12m bytes. I tried with 16M and it worked :) My question is how "far" I can go with increasing? Where is "the limit"? Why is not 24M as default in php.ini? Thanks! -afanif you set the memory_limit to 0, then the script has unlimited memory to its disposal.