Back

Problem running scheduled jobs


Quax posted 2 months ago

Hi guys,

I am trying to set up a schedule according https://laravel.com/docs/5.6/scheduling but I have problems that I cannot solve at this point. First problem was to run the cronjob with php7 but that is solved now. Now I get error messages like these:

PHP Notice:  Undefined index: argv in /my-local-path/htdocs/vendor/symfony/console/Input/ArgvInput.php on line 53

PHP Warning:  array_shift() expects parameter 1 to be array, null given in /my-local-path/htdocs/vendor/symfony/console/Input/ArgvInput.php on line 57 

PHP Parse error:  syntax error, unexpected '?', expecting variable (T_VARIABLE) in /my-local-path/htdocs/vendor/symfony/console/Output/Output.php on line 40

Any ideas? The ? mentioned there is about the ? in "?int", which I did not see before and I can't find any info about it. PHP 7 feature? But I am using PHP 7.

Edit: In case it helps, I am using this line to call the cronjob in the crontab:

* * * *	* php /my-local-path/htdocs/artisan schedule:run > /my-local-path/htdocs/storage/logs/cronjobs.log

Thanks for your help, Jens

Pardeeptech replied 2 months ago

You need to give the array_shift() the parameter! Look this example:

$stack = array("ora", "aghfg", "appe", "rab"); $fr = array_shift($stack); // Here you give the parameter print_r($fruit); You give the null parameter on array_shift() and you need to change it! also check syntax error like ; , "" line 40


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us