Allowed memory size of 268435456 bytes exhausted [duplicate]
Asked Answered
I

3

12

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?

Information answered 11/10, 2010 at 3:33 Comment(5)
show us some code. we need to know what's going on in the script.Intro
The script is the wordpress importer and the database file is a WML file (Wordpress Export File)Information
You change the memory_limit to be 1GB, but phpinfo() shows 2GB, and so all is ok ??Belicia
Sorry, it was a type. I've changed the 'memory_limit' to 2048M, not 1GBInformation
What location for the php.ini file does phpinfo() show? Did you modify that file, or another one?Unfolded
E
14

If the script you are using is borrowed from someone else make sure there is no ini_set('memory_limit', '256M') which would produce the exactly effect you are seeing in spite of any change you made in php.ini.

Eckhardt answered 8/10, 2011 at 22:46 Comment(0)
F
2

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.

Fadeless answered 11/10, 2010 at 3:39 Comment(2)
There are also a '/etc/php5/cli/php.ini' and memory_limit was set to '-1'.Information
Anyway I run the script through a web browser, not command lineInformation
B
0

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).

Boob answered 11/10, 2010 at 8:0 Comment(1)
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...Information

© 2022 - 2024 — McMap. All rights reserved.