skip to Main Content

I am new to Magento and am more used to scripting in PHP than doing Linux commands.

I tried setting up Cron Jobs for Magento as outlined here https://www.properhost.com/support/kb/41/How-to-Configure-Magento-2-Cron-Jobs but am getting an error email saying /bin/bash: php7: command not found

Ifound other articles that were leaving the version of PHP out of the command so it would be something like php -f /home/<username>/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/<username>/public_html/var/log/magento.cron.log, this is not emailing me any errors so thought I might have gotten somewhere but my site is still not reindexing.

Any ideas what I should do in this case?

Thanks

2

Answers


  1. Chosen as BEST ANSWER

    found the following in the log files bin/magento must be run as a CLI application so changed the command to php-cli and it seems to be working


  2. Replacing php with its path which php worked for me.

    /usr/local/bin/php -f /home/<username>/public_html/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /home/<username>/public_html/var/log/magento.cron.log 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search