views:

94

answers:

2

I'm handling witha 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?

+1  A: 

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

ThirdPartyCode
There are also a '/etc/php5/cli/php.ini' and memory_limit was set to '-1'.
Pennywise83
Anyway I run the script through a web browser, not command line
Pennywise83
A: 

Most probably wrong php.ini is used.

In the same phpinfo()-s output you can check what file is used exactly, search for "Configuration File".

You can call the phpinfo() function from your real script used, to be sure to get the settings for exactly your script (different settings can be used for different virtual hsots, paths, etc).

Levon Mirzoyan
I've added phpinfo() to the header of the script and it show me the same thing... memory_limit is set to 2048M but i receive the error message. I can't figure why this could be happening...
Pennywise83