在我的案例Zend的錯誤和nginx的 - PHP5 FPM,這樣的工作:
只有我把public/index.php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
沒有If(){...}
但如果只把上面的代碼,顯示錯誤,將給出:
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /usr/local/nginx/html/ZendSkeletonApplication/module/Album/src/Album/Controller/AlbumController.php on line 12
An其他的東西!設置此代碼:
'display_not_found_reason' => true,
'display_exceptions' => true,
在module.config.php這樣的:
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view',
'display_not_found_reason' => true,
'display_exceptions' => true,
),
),
我得到一個error.log中的所有錯誤在屏幕上:
Fatal error: Uncaught exception 'Zend\View\Exception\InvalidArgumentException' with message 'Invalid path provided; must be a string, received boolean' in /usr/local/nginx/html/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/View/Resolver/TemplatePathStack.php:201 Stack trace: #0 /usr/local/nginx/html/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/View/Resolver/TemplatePathStack.php(149): Zend\View\Resolver\TemplatePathStack->addPath(true) #1 /usr/local/nginx/html/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/Mvc/Service/ViewTemplatePathStackFactory.php(38): Zend\View\Resolver\TemplatePathStack->addPaths(Array) #2 [internal function]: Zend\Mvc\Service\ViewTemplatePathStackFactory->createService(Object(Zend\ServiceManager\ServiceManager), 'viewtemplatepat...', 'ViewTemplatePat...') #3 /usr/local/nginx/html/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php(939): call_user_func(Array, Object(Zend in /usr/local/nginx/html/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 946
我沒有」在系統(Ubuntu 14.04)中觸摸配置文件爲php-fpm。
檢查您的phpinfo()輸出爲您的php.ini - 記住php ini值可以在「額外的ini(dir)文件」中覆蓋,在php-fpm.conf文件中,在.user.ini文件中以及當然在執行php腳本文件 – Cybot