I’m new to Magento and I am having a trouble with Re-indexing.
I have checked all of the questions with re-indexing problem but my problem is different.
My Cron job is showing the following error:
Check https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors for more info on how to handle out of memory errors.
I have removed the memory_limit in php.ini, but it’s still the same.
My Cron Job:
***** php /home/username/public_html/update/cron.php >> /home/username/public_html/var/log/update.cron.log
The Following command:
* * * * * <path_to_php> <magento2_dir>/update/cron.php >> <magento2_dir>/var/log/update.cron.log
is giving the ouput
X-Powered-By: PHP/5.6.31
Content-type: text/html; charset=UTF-8
But. My index aren’t being reindexed. I’m using Cpanel.
2
Answers
You have to contact your server guy regarding that. They will increase the server memory limit. Or you can do on thing. First do the indexing using SSH and then try to set cron job. I hope it will help you.
you need to setup proper CRON for your Magento2 Web Store:
to setup CRON you need to do following :
login via SSH to your server
edit cronjobs with this command
after this a text editor displays. (You might need to choose a text editor first.)
here you need to add following lines ( make sure to change paths for your enviornment )
here:
<path_to_php>
is usually/usr/bin/php
you can find this by commandwhich php
if you have installed php-cli than you need to assign path for php-cli here
<magento2_dir>
is the Root directory for Magento2 Installation.Following is must have CRON for Magento2
Ex:
NOTE : IF you have cPanel or other Panels than you need to find cron / scheduler and setup the same there accordingly