Page 1 of 1

Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 6:34 pm
by blmg911
Hi, I have set up a test environment for my store which runs 1.5.5.1;

Updating to 2.0, I have the usual issues and managed to fixed them by editing the code.

However I still get this error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in /system/library/db/mysql.php on line 40

I have changed the allowed memory size as high as 500M.

And still this error is thrown out.

Any ideas?

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 6:54 pm
by alin
It's depend on what Virtual Server software you are using

For me, I'm using Appserv, I do the setting for php.ini from config menu of Appserv.

The right php.ini location for my case is Windows/php.ini (I'm using Appserv on Windows 7)

Hope this help

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 6:59 pm
by blmg911
I have set this up on my virtual private sever; Which is online;

OS is Debian GNU/Linux.

I'm not testing locally.

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 7:16 pm
by pm-netti
blmg911 wrote:I have set this up on my virtual private sever; Which is online;

OS is Debian GNU/Linux.

I'm not testing locally.
My php.ini:

Code: Select all

post_max_size = 20M
upload_max_filesize = 20M

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 7:27 pm
by blmg911
It doesn't seems to be the allowed memory setting in the php.ini file, as if I change this as high as 500M it will still create an error.

There must be some bad code somewhere that is using all this memory.

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 7:29 pm
by blmg911
If I change to mysqli, I still get the following error:

Fatal error: Allowed memory size of 260046848 bytes exhausted (tried to allocate 523800 bytes) in /system/library/db/mysqli.php on line 16

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 7:46 pm
by i2Paq
What if you do a clean install of 2.0?

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 8:08 pm
by pm-netti
blmg911 wrote:If I change to mysqli, I still get the following error:

Fatal error: Allowed memory size of 260046848 bytes exhausted (tried to allocate 523800 bytes) in /system/library/db/mysqli.php on line 16
Have you made changes in file /etc/php5/... php.ini file, or only trade of root to the file?

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 8:43 pm
by blmg911
I have changed both the file in the root folder, and the php.ini within my sever.

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 9:00 pm
by blmg911
i2Paq wrote:What if you do a clean install of 2.0?
Yeah I have also done a clean install, again on a VPS as a test (this issue does not exist).

It seems that the issue is only present when upgrading from 1.5.5.1.

As mentioned, this currently isn't affecting my web store as I have duplicated my original store's scripts and database and set it up online to test out the code and help find any bugs present.

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Mon Oct 13, 2014 9:15 pm
by i2Paq

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Tue Oct 14, 2014 5:52 am
by kwton
pm-netti wrote:
blmg911 wrote:If I change to mysqli, I still get the following error:

Fatal error: Allowed memory size of 260046848 bytes exhausted (tried to allocate 523800 bytes) in /system/library/db/mysqli.php on line 16
Have you made changes in file /etc/php5/... php.ini file, or only trade of root to the file?
but, that is not the case!
I believe allowed memory is meant either accessing the available ram or writing to the database, php uploading & http post has nothing to do with that error.

Try a clean install first, do not try to merge the opencart versions.

add to that, opencart includes it is own php.ini configuration ( apache module enabled by default ? ).

And yeah, return the php.ini to default value, 500Mb will break your server.
did you even run

Code: Select all

 # service apache2 restart 
to apply the changes ?

Re: Fatal error: Allowed memory, EVEN AFTER CHANGING PHP.INI

Posted: Tue Oct 14, 2014 6:38 am
by rph
Yeah, we're definitely at an early point where you shouldn't be upgrading to 2.0 unless you have strong dev skills.

@blmg911 - the error states you have a 260MB memory limit. Without knowing exactly what SQL query is being run you'll need to increase the memory limit again to complete the operation. You'll need to make sure that your global php.ini setting isn't overriding the local memory limit.

If that doesn't work fall back to your local machine to run the upgrade. That way you can leverage as much RAM as your local machine has. Then upload the upgaded database to your VPS.