【问题标题】:CakePHP shell script won't run as cron jobCakePHP shell 脚本不会作为 cron 作业运行
【发布时间】:2016-03-19 11:56:02
【问题描述】:

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

bin/cake myshell method

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

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 作业工具...

我做错了什么?

【问题讨论】:

    标签: php shell cakephp cron


    【解决方案1】:

    我打开调试,发现脚本实际上在它之前出错了我的参数。我用谷歌搜索了错误,结果是这样的:Cakephp 3 bin/cake bake - Undefined variable: argv

    调整了 php.ini 配置,它运行良好。

    【讨论】:

      最近更新 更多