简体   繁体   English

CakePHP Shell脚本无法作为cron作业运行

[英]CakePHP shell script won't run as cron job

I have written a shell script that works perfectly when I test it locally. 我编写了一个Shell脚本,当我在本地对其进行测试时,它可以完美地工作。

bin/cake myshell method

But when I assign it as a crob it's not working. 但是,当我将其分配为crob时,它将无法正常工作。 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

It appears that the two arguments to the script are being ignored. 似乎脚本的两个参数被忽略了。 I'm using the cron jobs tool in the cPanel... 我正在cPanel中使用cron作业工具...

在此处输入图片说明

What am I doing wrong? 我究竟做错了什么?

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 我搜索了错误,结果是这样的: Cakephp 3 bin / cake bake-未定义变量:argv

Tweaked the php.ini config and it worked perfectly. 调整了php.ini配置,使其完美运行。

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

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