Laravel 5.1 cron不在OVH工作

问题描述 投票:4回答:2

我试图在我的OVH中运行一个cron,但是它不接受命令:

php artisan schedule:run 1>> /dev/null 2>&1

发生了错误 :

enter image description here

它说:

The characters for the records are letters , numbers, and characters -_./ Moreover , it is forbidden to access parent folders
php laravel-5 ovh
2个回答
0
投票

使用Laravel文档上的示例以及工作目录的完整路径:

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

https://laravel.com/docs/master/scheduling


0
投票

使用这些内容创建文件cron.php

#!/usr/bin/env php
<?php
exec('php /path/to/artisan schedule:run', $output);
print_r($output);

确保编辑/path/to部分。然后在“添加调度”窗口的“要执行的命令”字段中输入cron.php。 ovh control panel add cron job


如果您遇到错误,请尝试检查cron.phpartisan的权限。可以使用这些命令修复权限。

$ chmod 777 cron.php
$ chmod 777 /path/to/artisan
© www.soinside.com 2019 - 2024. All rights reserved.