在ZendFramework 2上我需要通过cron运行脚本:
我已从Cpanel设置我的cron,如下所示:
php /home/cloud/public_html/production/trunk/public/index.php invoke
每天运行两次。
在检查我的电子邮件时,我在调用cron时收到以下警告:
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 />
当cron执行时,不会调用脚本...
答案 0 :(得分:2)
以下两篇文章帮助解决了这个问题:
基本上问题是托管问题很容易解决,我所做的只是改变我调用我的cron的方式:
/usr/local/php /home/cloud/public_html/production/trunk/public/index.php invoke