Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Zend Framework命令行查看错误_Php_Zend Framework_Command Line_Command Line Interface - Fatal编程技术网

Php Zend Framework命令行查看错误

Php Zend Framework命令行查看错误,php,zend-framework,command-line,command-line-interface,Php,Zend Framework,Command Line,Command Line Interface,我正在使用gregor的方法大纲为我的应用程序的某些部分创建命令行执行,如cron作业、管理任务等。但是,它可以工作,当我创建一个未定义的新对象时,不会报告任何错误,例如拼写错误和其他此类错误 我本以为php会报告一个错误,但它默默地失败了。这是什么原因?有没有更好的方法来实现我的目标?或者我如何实现这一点,以便能够看到错误 非常感谢 代码如下: 在public/index.php中 if(!defined('RUN_APP') || RUN_APP == true) { $appl

我正在使用gregor的方法大纲为我的应用程序的某些部分创建命令行执行,如cron作业、管理任务等。但是,它可以工作,当我创建一个未定义的新对象时,不会报告任何错误,例如拼写错误和其他此类错误

我本以为php会报告一个错误,但它默默地失败了。这是什么原因?有没有更好的方法来实现我的目标?或者我如何实现这一点,以便能够看到错误

非常感谢

代码如下:

在public/index.php中

if(!defined('RUN_APP') || RUN_APP == true)
{  
    $application->bootstrap()->run();
}
application/cron.php

define("RUN_APP",false);
require(realpath('/var/www/domain/public/index.php'));
$application->bootstrap();

//the rest

我想出来了。万一有人在看,我会回答的。我不知道为什么会这样,但是:

ini_set('display_errors', 'on');
在cron.php文件的顶部执行此操作。我想你可以扔一个:

error_reporting(E_ALL|E_STRICT);

这是很好的措施。令人费解的是,我在不使用命令行时会出现这些错误,并且我的index.php或bootstrap.php中没有上述行。因此,它们被设置在zend框架的其他地方。也许引导中的phpSettings.display_errors=1与此有关。

我也有同样的问题。错误显示在主命令行程序中,但如果未能实例化Zend模型对象,则不会显示。你建议的解决方案对我不起作用。谢谢你。