0

I created a script that takes data of products, categories and manufacturers, and inserts them automatically in the database prestashop. In version 1.6 of prestashop script that works well, but in the new version (1.7) data is inserted normally, but when I go to edit a product from backoffice get an error 500. I tried to enable the debug version to understand the problem but nothing always error 500. After several tests I realized that the problem stems from the categories, because if I delete the class to the table "category" product modification works, but I can not figure out what data bears this problem, how can I find the error exact?

sorry for my English, i'm Italian.

EDIT: I managed to enable the errors, they now these three errors are displayed:

Fatal error: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 20480 bytes) in /var/www/vhosts/passiontech.it/httpdocs/classes/db/DbPDO.php on line 154

Fatal error: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 32768 bytes) in /var/www/vhosts/passiontech.it/httpdocs/vendor/symfony/symfo‌​ny/src/Symfony/Compo‌​nent/Debug/Exception‌​/OutOfMemoryExceptio‌​n.php on line 1

Fatal error: Allowed memory size of 1048576000 bytes exhausted (tried to allocate 147456 bytes) in Unknown on line 0

EDIT2: I tried to eliminate all the products, but the problem persists after doing so, that I can not add products, to do so I have to delete the categories, then the problem lies in the categories, then my question is: what, in the categories, can cause a 500 error?

peppinoibra
  • 139
  • 1
  • 10
  • "500 Internal Server Error" (or a blank page) means your script is throwing an error but PHP is configured to hide it from you. You need to fix it ASAP because coding without the aid of error messages is hard. As quick start, you can set the `error_reporting` and `display_errors` directives in your computer's system-wide `php.ini` file ([details here](http://stackoverflow.com/a/5680885/13508)). Errors thumb rule: show in development, log in production. – Álvaro González Feb 07 '17 at 10:16
  • Thanks, now I get tgre mistakes that I added to the thread – peppinoibra Feb 07 '17 at 14:27
  • Your script is trying to use more than 1 GB of RAM, which is **a lot**. You're doing something terribly inefficient or maybe have an infinite loop. (I know nothing about Prestashop so I can't really tell you what.) – Álvaro González Feb 07 '17 at 15:09
  • please attach the code – Wolfack Feb 07 '17 at 15:14
  • This error occurs when you try to change a product from prestashop back office, my script is running without problems. – peppinoibra Feb 07 '17 at 15:18
  • An obvious ways to obtain an infinite loop with categories is having a hierarchical structure with a wrong parent ID. (But, as I said, I know nothing about that software.) – Álvaro González Feb 07 '17 at 15:40
  • Changing the memory_limit by ini_set('memory_limit', '-1'); is NOT a solution at all. Please don't do that. Obviously, PHP has a memory leak somewhere and you are telling the server to just use all the memory that it wants. The problem has not been fixed at all. If you monitor your server, you will see that it is now probably using up most of the RAM and even swapping to disk. You should probably try to track down the exact bug in your code and fix it. – Knowband Plugins Feb 13 '17 at 12:02

0 Answers0