Page 1 of 1

PHP Limits...

Posted: Sun Jun 07, 2020 12:38 am
by Zanato
Hi,

So I had a few bogey image directory names and thought I'd clean them up.

Exported the database tables, oc_product and oc_product_image. Find and Replace on the required changes, save, and import back in.

Except it won't import!! OC tells me upload_max_filesize and post_max_size are both 32MB. The sql file is only 905KB but I'm getting "

Code: Select all

PHP Fatal error:  Allowed memory size of 402653184 bytes exhausted
". So I increase the limits, 128MB, still not big enough. So I increase to 628MB and now I'm getting max execution time of 60 seconds exhausted.

Surely this can't be right for a <1MB .sql file, no?

Re: PHP Limits...

Posted: Sun Jun 07, 2020 5:52 am
by EvolveWebHosting
It does not sound right unless your hosting company is being very restrictive. Contact them to raise it or send them the file to import over command line.

Re: PHP Limits...

Posted: Sun Jun 07, 2020 6:02 pm
by OSWorX
Zanato wrote:
Sun Jun 07, 2020 12:38 am
Exported the database tables, oc_product and oc_product_image. Find and Replace on the required changes, save, and import back in.

Except it won't import!! OC tells me upload_max_filesize and post_max_size are both 32MB. The sql file is only 905KB but I'm getting "PHP Fatal error: Allowed memory size of 402653184 bytes exhausted". So I increase the limits, 128MB, still not big enough. So I increase to 628MB and now I'm getting max execution time of 60 seconds exhausted.

Surely this can't be right for a <1MB .sql file, no?
And why do you not import that data with the database tool phpMyAdmin?
Sure, it should work also with the internal import tool, but as long as that makes troubles, you can import that always by yourself without asking someone else.

Re: PHP Limits...

Posted: Sun Jun 07, 2020 9:47 pm
by straightlight
Or ... you could always create a new service request in the Commercial Support section of the forum, or use the Resources link at the top of the forum to contact a reliable Opencart partner or contact me directly to get this done as a custom job.

Re: PHP Limits...

Posted: Mon Jun 08, 2020 5:09 pm
by Zanato
OSWorX wrote:
Sun Jun 07, 2020 6:02 pm
And why do you not import that data with the database tool phpMyAdmin?
Thanks for the suggestion. It's how I had to do it in the end. I would often just use phpMyAdmin for little changes here and there but for this I thought it would be easier to use Backup & Replace (which I often use on some of my other sites). I had a staff member upload a load of new products and they had some spaces in image folder names, image file names, and in SEO keywords so a quick backup of the table, Find and Replace the spaces, and restore. It's a 60 second job, or at least, should be.

But it wouldn't restore. First I was getting the memory errors and then when I vastly increased my PHP limits it would hang for a min on import and then suddenly EXPORT the database! I thought to myself there is something wrong somewhere but couldn't find any mention on the forums so decided to make a post to see if anyone knew what it could be.

In the end I installed a new copy of 2.3.0.2 on localhost to test it and low and behold after exporting a single table and then trying to restore it back in, it instead exports the whole database. So then I thought this must be a problem with Chrome so I tried it with IE but got the same result. Tried switching from PHP5.6 to PHP7.1, same result. Tried switching from mysqli to mysql and again, same result. So then I tried on a 2.2.0.0 site I have and restore doesn't work there either. So it must be a bug. I'm just amazed I haven't come across it before and I can't find much on it in the forum. It does work on the old 1.5.6 sites I still run and it does seem to work on 3.0.

Re: PHP Limits...

Posted: Mon Jun 08, 2020 5:56 pm
by OSWorX
Supporting several hundreds of clients with version from 1.4. - 3.0.x but never ever had such problems.
Except the server limits were too less and the import too big - but that's another issue.

Regarding the wrong image folder and names, if I would be you, I would
1. talk with that guy to not use spaces anywhere
2. install additionally a small modification which fix all of that automatically (did that at some clients, because some do not think further there nose is long ..)

Re: PHP Limits...

Posted: Sat Oct 17, 2020 10:54 am
by mikahawkins
Hello,
A PHP memory limit of 128MB should be more than enough for most sites unless you have a plugin that needs more. If you want to see how much memory different plugins use, install the Server IP & Memory Usage Display plugin
Regards,
Mika Hawkins

Re: PHP Limits...

Posted: Sat Oct 17, 2020 4:57 pm
by khnaz35
mikahawkins wrote:
Sat Oct 17, 2020 10:54 am
Hello,
A PHP memory limit of 128MB should be more than enough for most sites unless you have a plugin that needs more. If you want to see how much memory different plugins use, install the Server IP & Memory Usage Display plugin
Regards,
Mika Hawkins
Something like this
https://www.opencart.com/index.php?rout ... sort=price

Re: PHP Limits...

Posted: Sun Oct 18, 2020 5:29 am
by IP_CAM
It does work on the old 1.5.6 sites ...
happy to hear that ... :D