emersonthis
emersonthis

Reputation: 33348

CakePHP shell script won't run as cron job

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

bin/cake myshell method

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

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

enter image description here

What am I doing wrong?

Upvotes: 1

Views: 642

Answers (1)

emersonthis
emersonthis

Reputation: 33348

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

Tweaked the php.ini config and it worked perfectly.

Upvotes: 1

Related Questions