View Full Version : Problem with memory limit

03-09-2009, 03:21 AM
Hi all,

I have a problem with writing a table from php to an excel table. and I got the following message in the excel instead

"Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 328 bytes) in \\apsg-build7\www\petra\lib\excel\ExcelWriter.php on line 312"

the error appear just recently, possibly after more data is added into the table.

Now I googled the error and is said that I should increase the memory limit in php.ini, I did that already, and it wasn't even 32M to start with. I also checked .htaccess file to check it is overwritten, but it also doesn't.

Any idea what can happen here?

Thank you

03-09-2009, 06:55 AM
It could be memory limit problem or it could be problem with excel data.
The data you are trying to enter should not exceed the memory limit or the max number of rows for the excel application.
The max number is 65536 rows.
And for memory limit problems, try this
write the below code at the top of your php file.


03-10-2009, 07:28 AM

it didn't work.
I also changed the php.ini file memory limit to -1, and I checked in phpinfo() the limit already set to -1
and the excel file doesn't exceed 65536

any idea what else can cause this?