I had created cron.php file in my project and added the script.This is the code inside the file and setup cron job once per 5 minutes successfully even I got mail notifications too.

/usr/local/bin/php /usr/local/php56/bin/php-cli /home/username/public_html/bin/magento indexer:reindex

/usr/local/bin/php /usr/local/php56/bin/php-cli /home/username/public_html/bin/magento cron:run

/usr/local/bin/php /usr/local/php56/bin/php-cli /home/username/public_html/update/cron.php

/usr/local/bin/php /usr/local/php56/bin/php-cli /home/username/public_html/bin/magento setup:cron:run

/usr/local/bin/php /usr/local/php56/bin/php-cli /home/username/public_html/bin/magento cache:clean

/usr/local/bin/php /usr/local/php56/bin/php-cli /home/username/public_html/bin/magento cache:flush

Whenever the cron file is running there should be a change in cron_shedule table,unfortunately I found that there is no change in the table.But when I run the command through ssh (magento cron:run) values are generated in table and showing status as pending .


I guess that your php path location is wrong

You should use


instead of

/usr/local/bin/php /usr/local/php56/bin/php-cli

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.