我在使用Valet时无法在本地服务器上运行我的cron。以下是我的操作:
- 当我运行
php artisan command:mycommand
命令时,该命令会运行。 - 当我运行
php artisan schedule:run
命令时,该命令也会运行。
输出结果:
Running scheduled command: '/usr/local/Cellar/php70/7.0.13_6/bin/php' 'artisan' game:resources > '/dev/null' 2>&1 &
根据Laravel文档,它建议我将以下内容添加到我的crontab中。
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
在我的项目目录中,这是当前路径。
/Users/tjhillard/Projects/galaxywars
当我在laravel项目根目录下尝试使用crontab -e
并保存以下内容时:
* * * * * php /Users/myusername/Projects/projectname schedule:run >> /dev/null 2>&1
...它无法正常工作。我尝试了几个变体,但都没有成功。你有什么想法我做错了什么吗?
我在使用Valet的macOS系统。