简体   繁体   English

无法使用Laravel Artisan Scheduler执行外部PHP

[英]Cannot execute external PHP with Laravel artisan scheduler

I have an external PHP script, that is processing an XML array to insert, update or delete rows in a database. 我有一个外部PHP脚本,该脚本正在处理XML数组以插入,更新或删除数据库中的行。 This script lies in the root of the project in a folder called scripts and I can run and execute it via terminal with no problems whatsoever and it updates the database accordingly: 该脚本位于项目的根目录下的脚本文件夹中,我可以通过终端运行和执行它,而不会出现任何问题,它会相应地更新数据库:

php index.php 

I have also set up a schedule in Laravel (using October CMS syntax) 我还在Laravel中设置了时间表(使用October CMS语法)

public function registerSchedule($schedule)
{
 $schedule->exec(public_path() . '/script/index.php')->everyMinute();
}

This however is doing nothing. 但是,这无济于事。 I tried manually running the schedule with artisan in command line by: 我尝试通过以下方式与工匠在命令行中手动运行计划:

php artisan schedule:run

And the output is 输出是

Running scheduled command: /Users/x/x/x/x/scripts/index.php > '/dev/null' 2>&1 &

Nothing happens in the database tho. 在数据库中什么也没有发生。

您是否尝试生成新密钥?

php artisan generate:key

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM