CakePHP Shell脚本无法作为cron作业运行 [英] CakePHP shell script won't run as cron job

查看:78
本文介绍了CakePHP Shell脚本无法作为cron作业运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个shell脚本,当我在本地对其进行测试时,它可以完美运行。

I have written a shell script that works perfectly when I test it locally.

bin / cake myshell方法

但是当我将其分配为crob时,它不起作用。相反,我看到默认的蛋糕输出:

But when I assign it as a crob it's not working. Instead I see the default cake output:

Welcome to CakePHP v3.1.4 Console
---------------------------------------------------------------
App : src
Path: /home/fantastagram/public_html/src/
PHP : 5.6.16
---------------------------------------------------------------
Current Paths:

* app:  src
* root: /home/fantastagram/public_html
* core: /home/fantastagram/public_html/vendor/cakephp/cakephp

Available Shells:

[Migrations] migrations

[CORE] i18n, orm_cache, plugin, routes, server

[app] console, instagram

To run an app or core command, type `cake shell_name [args]`
To run a plugin command, type `cake Plugin.shell_name [args]`
To get help on a specific command, type `cake shell_name --help`

Content-type: text/html; charset=UTF-8

脚本的两个参数似乎被忽略了。我正在cPanel中使用cron作业工具...

It appears that the two arguments to the script are being ignored. I'm using the cron jobs tool in the cPanel...

我在做什么错了?

推荐答案

我打开调试程序,发现脚本实际上在出错在我的参数之前。我用错误搜索了一下,结果是这样的: Cakephp 3 bin /蛋糕烘烤-未定义变量:argv

I turned on debugging and found that the script was actually erroring out before it to my parameters. I googled the error and it turned out to be this: Cakephp 3 bin/cake bake - Undefined variable: argv

调整了php.ini配置,使其完美运行。

Tweaked the php.ini config and it worked perfectly.

这篇关于CakePHP Shell脚本无法作为cron作业运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆