Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allowed memory size of 268435456 bytes exhausted [duplicate]

Possible Duplicate:
Allowed memory size of X bytes exhausted

I'm handling with a quite little big database (87mb) import and to do that I use a php script. All the operations are made in locale with an apache installation on Ubuntu Lucid.

When I run the script after few minutes I receive this error:

Allowed memory size of 268435456 bytes exhausted 

I've changed memory_limit to 2GB in php.ini file and restarted apache. After that I've checked phpinfo() and I see that memory_limit is set to '2048M' so all is ok.

But when i relaunch my script i receive the same error, 256mb memory limit exahusted.

Where am I wrong?

like image 368
Pennywise83 Avatar asked Oct 11 '10 03:10

Pennywise83


People also ask

How do I fix fatal error allowed the memory size of 134217728 bytes exhausted?

The correct way is to edit your php. ini file. Edit memory_limit to your desire value. As from your question, 128M (which is the default limit) has been exceeded, so there is something seriously wrong with your code as it should not take that much.

How do I fix the allowed memory size 1610612736 bytes exhausted?

Try prefixing your command with COMPOSER_MEMORY_LIMIT=-1 . This will remove the memory limit for the execution of the command. Update: Memory exhaust errors should now be resolved by using Composer 2.

What is the maximum PHP memory limit?

Increasing the PHP memory limit The default memory limit is 256M and this is usually more than sufficient for most needs. If you need to raise this limit, you must create a phprc file.


1 Answers

Ubuntu has two php.ini's, one for apache and one for cli.
Are you sure you edited the right one?
The one for command line is usually in /etc/php5/cli/php.ini.

like image 159
Vid Luther Avatar answered Sep 19 '22 22:09

Vid Luther