HappyCoder
HappyCoder

Reputation: 6155

ZF2 - Cron error messages via console

On ZendFramework 2 I need to run a script via cron:

  1. I have setup a console route
  2. The script runs without an issue via console: php /public/index.php invoke
  3. I have setup my cron as follows from Cpanel:

    php /home/cloud/public_html/production/trunk/public/index.php invoke

which is run twice a day.

On checking my email, I get the following warning when the cron is invoked:

X-Powered-By: PHP/5.5.15
Set-Cookie: PHPSESSID=30c0ee6dd4c9b11c5c1bb716b802b352; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-type: text/html

<br />
<b>Warning</b>:  strpos(): Empty needle in <b>/home/cloud/public_html/production/trunk/vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/Request.php</b> on line <b>518</b><br />
<br />
<b>Warning</b>:  strpos(): Empty needle in <b>/home/cloud/public_html/production/trunk/vendor/zendframework/zendframework/library/Zend/Http/PhpEnvironment/Request.php</b> on line <b>524</b><br />

The script is not being invoked when the cron executes...

Upvotes: 0

Views: 444

Answers (1)

HappyCoder
HappyCoder

Reputation: 6155

The following two posts helped solve this issue:

  1. ZF2 ON GITHUB
  2. CPANEL FORUMS

Essentially the issue is a hosting problem which is pretty easy to sort out, all I did was to change how I called my cron:

/usr/local/php /home/cloud/public_html/production/trunk/public/index.php invoke

Upvotes: 2

Related Questions