I'm trying to to enable the "Anchor" flag on a category with about 1400 products. When I click save, the page loads for a very long time (about 45 minutes) and finally gives me an internal server error 500.
I tried the same with a category with about 500 products, there it worked after about 20 minutes (still much too long but no error).
I get the following error in the php error log:
PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 33554440 bytes) in /Users/myuser/Sites/myproject/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php on line 3551
PHP settings:
memory_limit = 1024M # in .user.ini
max_execution_time = 18000 # in .user.ini
post_max_size = 32M
max_input_vars = 100000
MySQL Settings:
max_allowed_packet = 1024M
wait_timeout = 180
Environment:
Installation: MAMP PRO
PHP-Version: 7.0.8.
Magento Settings:
- Version: 2.1.7
- All indexes are set to "UPDATE BY SCHEDULE" and were run
- Use flat category: YES (also tried with NO)
- Use flat product: YES (also tried with NO)
- Caches are cleared
- Tried clearing /var/generation folder
So basically, I tried everything I could find on the internet but nothing seemed to help. Of course I can now try to set memory_limit to 2056 but then it needs like 2 hours – I don't think that's a solution.
What can I do?
Best Answer
You should change the memory_limit from php.ini into as memory_limit = 536870912