skip to Main Content

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

Can anyone help?enter image description here

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


  1. 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.

    Login or Signup to reply.
  2. 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

    crontab -e

    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 )

    * * * * * <path_to_php> <magento2_dir>/bin/magento cron:run | grep -v "Ran jobs by schedule" >> <magento2_dir>/var/log/magento.cron.log
    * * * * * <path_to_php> <magento2_dir>/update/cron.php >> <magento2_dir>/var/log/update.cron.log
    * * * * * <path_to_php> <magento2_dir>/bin/magento setup:cron:run >> <magento2_dir>/var/log/setup.cron.log
    

    here:

    <path_to_php> is usually /usr/bin/php you can find this by command which 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

    bin/magento cron:run
    

    Ex:

    * * * * * /usr/bin/php /home/username/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/username/public_html/var/log/magento.cron.log
    * * * * * /usr/bin/php /home/username/public_html/update/cron.php >> /home/username/public_html/var/log/update.cron.log
    * * * * * /usr/bin/php /home/username/public_html/bin/magento setup:cron:run >> /home/username/public_html/var/log/setup.cron.log
    

    NOTE : IF you have cPanel or other Panels than you need to find cron / scheduler and setup the same there accordingly

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search