Post by RideTheWave » Tue Jun 12, 2018 12:32 pm

Today I suddenly got the error message:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 68 bytes) in /home/myservername/public_html/vqmod/vqmod.php on line 168
This message is appearing in both the front end and the backend. After about a year of using OpenCart, this is the first time an error caused the site to completely go down. What fixed the issue was deleting vqmod/checked.cache and vqmod/mods.cache. I don't want to have to keep doing this whenever the site goes down. Is there a way to fix this so it doesn't happen again? Perhaps a setting in the php.ini file? These are the settings in my current php.ini file:

Code: Select all

magic_quotes_gpc = Off;
register_globals = Off;
default_charset	= UTF-8;
memory_limit = 256M;
max_execution_time = 36000;
upload_max_filesize = 8M;
safe_mode = Off;
mysql.connect_timeout = 20;
session.auto_start = Off;
session.use_only_cookies = On;
session.use_cookies = On;
session.use_trans_sid = Off;
session.cookie_httponly = On;
session.gc_maxlifetime = 3600;
allow_url_fopen = on;
;display_errors = 1;
;error_reporting = E_ALL;
max_input_vars = 2500;
Can anyone recommend anything to prevent this from happening again? Either in the php.ini file or anywhere else? I'm using OpenCart 2.3.0.2. Any suggestion would be greatly appreciated.

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by synapseindia » Tue Jun 12, 2018 4:38 pm

Hi

Try to increase below fields in php.ini file .

Code: Select all

memory_limit = 256M;
max_execution_time = 36000;
upload_max_filesize = 8M;
Thanks

New member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by RideTheWave » Tue Jun 12, 2018 5:36 pm

Ok, I'll try doing that. I wouldn't want to put values that are too high though. Do you have a recommended number that I should put for each?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by thekrotek » Tue Jun 12, 2018 5:58 pm

memory_limit = 512M;
upload_max_filesize = 128M;

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Active Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by synapseindia » Tue Jun 12, 2018 6:04 pm

Code: Select all

memory_limit = 512M; 
upload_max_filesize = 32M;
Above values is fine.

New member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by RideTheWave » Tue Jun 12, 2018 6:46 pm

Ok, I made the changes. Should I still keep my eye out on for the size of the vqmod/checked.cache and vqmod/mods.cache files in case they get too large? Do those files just keep getting larger and larger? Or is there is a limit on how large they get?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by synapseindia » Tue Jun 12, 2018 9:10 pm

It is cache files. You can set the cron on server to delete these cache files every month or 15 days. VQMod will regenerate those files automatically.

New member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by straightlight » Tue Jun 12, 2018 10:11 pm


The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by RideTheWave » Thu Jun 14, 2018 2:09 pm

So is it normal for the vqmod/checked.cache and vqmod/mods.cache files to keep getting larger and larger as time passes? Are we SUPPOSED to be deleting those files regularly? I don't mind doing it, I'm just wondering if this is normal or if there is something wrong in my setup.

If these files are supposed to get larger and larger as time passes, then does it matter what you put as the memory limit in the php.ini file? Sooner or later wouldn't that memory limit get exceeded when these files get larger and larger?

New member

Posts

Joined
Fri May 19, 2017 8:29 am

Post by synapseindia » Thu Jun 14, 2018 5:28 pm

Those file didn't take much memory so i am wondering why your store taking this memory . It is just cache files for the modification which you are using for vqmod xml changes. There might be any extension which is creating problem . You need to cleanup your store files to find out the reason. It would be great if you can check by disable/enable extension one by one and check cache file size .

New member

Posts

Joined
Thu Apr 05, 2018 2:27 pm

Post by IP_CAM » Fri Jun 15, 2018 1:35 am

Well, all this has nothing to do with VqMod, that's for sure. :crazy: But no-one yet
told you, that your php.ini Memory Setting Value always depends on
the AMOUNT of Memory, you're allowed to use, and if you use a cheap Hoster,
this Value might be limited to less than i.E. 128 Megabytes.
In more professional Hostings, it can be set in the Server Admin PHP Section,
as shown on the image below.
And I then find a user.ini file in my Site Root, looking like this:

Code: Select all

[PHP]
memory_limit = 640M
Just to have it mentioned ... ;)
Ernie
---
Image

Attachments

set_php_server_memory_limit.jpg

set_php_server_memory_limit.jpg (88.19 KiB) Viewed 62 times


Ernie's OpenCart v.1.5.6.5 LIGHT + V-Pro + OpenShop Admin v.1.75 Test Sites
http://www.bigmax.ch - http://www.opencart.li/shop/ - http://www.velomech.ch/cart/
Image


User avatar
Guru Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by RideTheWave » Fri Jun 15, 2018 9:14 am

Thanks for all your replies. I think I may have solved the problem and it appears to have been both a memory issue as well as a vqmod issue. When I looked at the checked.cache file, it was creating a duplicate line upon every page load. That duplicate line was:

Code: Select all

/home/mysite/vendor/autoload.php
So after a year, this file just got larger and larger because of that one line that kept being duplicated. Eventually the file got too large, exceeding the memory limit and giving the fatal memory size error.

This is discussed in more detail here: https://github.com/vqmod/vqmod/issues/94 and they recommend a few fixes. What I ended up doing was commenting out lines 89-91 in the system/startup.php file:

Code: Select all

if (is_file(DIR_SYSTEM . '../../vendor/autoload.php')) {
	require_once(DIR_SYSTEM . '../../vendor/autoload.php');
}
and so far it seems to have worked. There are no more of that duplicate line being created in the checked.cache file. I will probably still delete that file on a regular basis just to be safe and to keep the site's performance as optimal as possible.

New member

Posts

Joined
Fri May 19, 2017 8:29 am
Who is online

Users browsing this forum: No registered users and 21 guests