user2565 Lähettäjä Tuntematon Jäsen alkaen jouluk. -0001 user2565 13 huhtik. 2016 02:04 Hi all Posting this in the hope it might help someone else! I have been struggling with 3 different errors when opening a LiteCart catalogue page (although the admin side was fine). I'm sure others can offer a better explanation but I did fix my problem in the end. The errors seemed to be related to three things. Perhaps MySQL: Warning: mysqli_query(): (HY000/2008): Out of memory in ~/includes/library/lib_database.inc.php (Line 162) Fatal error: 2008 - Out of memory select c.id, c.parent_id, ci.name from uksc-5rr-u-024608.lc_categories c left join uksc-5rr-u-024608.lc_categories_info ci on (ci.category_id = c.id and ci.language_code = 'en') where c.id = '3' limit 1; in ~/includes/library/lib_database.inc.php (Line 298) Perhaps PHP memory: Fatal error: Out of memory (allocated 34078720) (tried to allocate 544 bytes) in /home/cluster-sites/{restofthepath}/public_html/includes/library/lib_database.inc.php on line 162" Then the general 500 error message from the default .htaccess: Internal Server Error My host increased PHP memory which didn't help. I tried changing PHP versions without any real change. I did fresh installs of 1.3.3.1 (to be consistent with what my client is using), following instructions at http://wiki.litecart.net/doku.php?id=how_to_move_the_platform but this broke things too on 2 other hosts and a local MAMP stack, with all the same issues. Naturally by this time I was starting to think it was either LiteCart or the way that it was being used. Maybe should add that I have no vQmods or other addons installed. Did a fresh install then used CSV import to first bring in categories -- fine, site still working. Then used CSV import to bring in the products -- this broke it, back to "Internal Server Error". No idea why this would lead to a 500. On a hunch and going back to the original mysqli_query() error which mentions a problem with a join and categories, I deleted each entry from the lc_categories() table which fixed it on the fresh install, and also fixed it on the client site. One possibly important observation is that my client seems to have created duplicate category names; they also have managed to create duplicate product names. I will tell them that this makes no sense on any level... but also that this may be related to the problems they have faced. Hope this all made sense... I would love to know if there is anything I can do to clean the situation up further -- e.g. should I remove all trace of categories by ditching all entries from the lc_categories_info table? Thanks TiM for a great product -- night everyone :)
tim Founder Lähettäjä Sweden Jäsen alkaen toukok. 2013 tim 13 huhtik. 2016 07:39 My first guess was PHP memory leaks from either php bugs or bad compilations. To recover from that simply try another PHP version. It's not unusual as I had two clients with the problem In the past. I see you already tried that. LiteCart just uses a few MB (like < 5 MB) when processing pages. Except for when you resize images using GD2. Unless you are dealing with high Megapixel images this should be unecessary. Then this setup with categories makes me think perhaps LiteCart goes into an endless loop or something. Make sure there are no categories in the hierarchy that are mounted to themselves or a descendant. But you say even the fresh install crashes. I have no idea what is causing these problems and I sure would like to know. Make sure your ip address is in includes/config.inc.php or there will always be a HTTP 500 blank page upon an error. I have seen Apache throw HTTP 500 errors anyway but you are better off with your IP in there. The htaccess setting is to override any thirdparty error pages like branded by your web host.
user2565 Lähettäjä Tuntematon Jäsen alkaen jouluk. -0001 user2565 13 huhtik. 2016 08:23 Hi TiM Yep, I tried everything from 5.3 up on the various hosts! IP address was set in config.inc.php at install time. If anything like this comes back I'll be sure to let you know, but at present it seems like the weirdest thing about this particular site was indeed the category and/or product names being duplicated. I thought initally it was to do with the product images somehow, but the error occurs even before the images have been uploaded into the fresh setup. Would it make sense to have LiteCart actively prevent duplicates or mounting to self or descendants? In a logical sense, it doesn't make sense to me that you would want to confuse visitors with either of these approaches anyway. Anyway thanks again! Tom
tim Founder Lähettäjä Sweden Jäsen alkaen toukok. 2013 tim 23 huhtik. 2016 01:39 There should be code preventing a mount to a descendant or self. Perhaps it's not working after many version upgrades? Are you saying you can mount to self or descendants without warnings?
user2565 Lähettäjä Tuntematon Jäsen alkaen jouluk. -0001 user2565 26 huhtik. 2016 15:45 It seemed that the client had managed to mount to descendants from memory, yes. Apologies, was under pressure fix it so had tried a few things and can't confirm. One thing that is my own doing now though it seems, having prevented the error mentioned above, there are no products showing up in Catalog, even in the [Root] section. I can find products by searching, but wondered if there was a way (possibly through SQL) I could make sure all were set to Root so the client can rearrange them into the desired categories again?
tim Founder Lähettäjä Sweden Jäsen alkaen toukok. 2013 tim 29 huhtik. 2016 17:24 All category mounts are set in lc_categories column parent_id. Simply set parent_id to 0.