Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel-Windows上的Cron作业_Php_Cron_Laravel_Laravel 4 - Fatal编程技术网

Php Laravel-Windows上的Cron作业

Php Laravel-Windows上的Cron作业,php,cron,laravel,laravel-4,Php,Cron,Laravel,Laravel 4,我将此添加到框架中:'liebig/cron' 我将该代码添加到routes.php中: Route::get('/cron/run/c68pd2s4e363221a3064e8807da20s1sf', function () { Cron::add('example1', '* * * * *', function() { $u = User::find(5); $u->fullname = time(); $u->save

我将此添加到框架中:
'liebig/cron'

我将该代码添加到routes.php中:

Route::get('/cron/run/c68pd2s4e363221a3064e8807da20s1sf', function () {
    Cron::add('example1', '* * * * *', function() {
        $u = User::find(5);
        $u->fullname = time();
        $u->save();
    });
    $report = Cron::run();
    print_r ($report);
});
该页面将是:
http://localhost:8000/cron/run/c68pd2s4e363221a3064e8807da20s1sf

我试图通过任务调度器创建cron作业,我使用参数“localhost:8000/cron/run/c68pd2s4e36221a3064e8807da20s1sf”对
'c:/wamp/bin/php/php5.4.12/php.exe进行了操作,但没有成功

使用chrome的唯一方法是:
'C:\Users\*****\AppData\Local\Google\Chrome\Application\Chrome.exe'带参数'http://localhost:8000/cron/run/c68pd2s4e363221a3064e8807da20s1sf“

但我不想要它,我希望它能通过php运行,而不需要每分钟打开chrome

有没有办法让该页面由php.exe运行


我希望你能理解这个问题。谢谢。

那是因为你用错了工具。你有安装吗?如果你有,你可以做一个:

curl -i http://localhost:8000/cron/run/c68pd2s4e363221a3064e8807da20s1sf
或者,尝试ping命令:

ping http://localhost:8000/cron/run/c68pd2s4e363221a3064e8807da20s1sf

使用这两行创建批处理文件

cd c:\laravel-project\
c:\php5\php.exe artisan schedule:run 1>> NUL 2>&1
转到Windows 10任务计划程序

单击创建基本任务,选择何时登录触发器,然后选择启动程序->您的.bat文件。 选中“打开属性对话框”选项,然后单击“完成”。
在任务属性中,单击触发器,然后单击新建并添加新触发器每1分钟重复一次任务

以及我应该如何使其每分钟重复一次?