[英]Magento Cron jobs /bin/bash: php7: command not found
I am new to Magento and am more used to scripting in PHP than doing Linux commands.我是 Magento 的新手,更习惯于用 PHP 编写脚本而不是 Linux 命令。
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
我尝试按照此处的概述为 Magento 设置 Cron 作业
https://www.properhost.com/support/kb/41/How-to-Configure-Magento-2-Cron-Jobs
但收到错误电子邮件说/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
我发现其他文章将 PHP 版本排除在命令之外,因此它类似于
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
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. 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
,这不会给我发送任何错误,所以我以为我可能已经到达某个地方,但我的网站仍然没有重新索引。
Any ideas what I should do in this case?在这种情况下我应该做什么?
Thanks谢谢
在日志文件bin/magento must be run as a CLI application
发现以下内容bin/magento must be run as a CLI application
因此将命令更改为 php-cli 并且它似乎正在运行
更换php
及其路径which php
为我工作。
/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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.