display_errors for php5-fpm not working with nginx

前端 未结 3 996
野性不改
野性不改 2020-12-13 14:43

I am running nginx with php5-fpm and want to enable the display_errors. I am running a virtual host, so please help in making a way to enable display_erro

3条回答
  •  孤城傲影
    2020-12-13 15:08

    In my case Zend errors and NGinX - php5 fpm, work like this:

    Only I put in public/index.php

    error_reporting(E_ALL | E_STRICT);
    ini_set('display_errors', 1);
    

    Without If(){...}

    But If only to put above code, display error, will give this:

    Parse error: syntax error, unexpected '}', expecting ',' or ';' in /usr/local/nginx/html/ZendSkeletonApplication/module/Album/src/Album/Controller/AlbumController.php on line 12
    

    Another thing! Set up this code:

    'display_not_found_reason' => true,
    'display_exceptions'       => true,
    

    in module.config.php like this:

    'view_manager' => array(
         'template_path_stack' => array(
             'album' => __DIR__ . '/../view',
             'display_not_found_reason' => true,
             'display_exceptions'       => true,
         ),
     ),
    

    I get all errors of an error.log on screen:

    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
    

    I didn't touch config file as php-fpm in system (Ubuntu 14.04).

提交回复
热议问题