Witam
Mam problem z poprawnym uruchomieniem aplikacji ZF2 pod NginX-em na Debianie Wheezy.
Zainstalowałem i skonfigurowałem PHP i FastCGI (spawn-fcgi) wg. tego tutoriala:
http://www.nibyblog.pl/instalacja-serwera-www-nginx-z-obsluga-php-przez-fastcgi-i-mysql-1695.html
Skrypt z phpinfo(); działa, ale ZendSkeletonApplication już nie. Wyświetla się Error 500.
W Logu:
Uncaught exception 'RuntimeException' with message
'Unable to load ZF2. Run `php composer.phar install` or define
a ZF2_PATH environment variable.'
Dodałem zmienną ZF2_PATH to wysypało szereg wyjątków...
2013/05/03 18:34:34 [error] 8217#0: *4 FastCGI sent in stderr: "PHP Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' in /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:302
Stack trace:
#0 /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php(126): Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\Cache\Serv...')
#1 /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php(223): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\ServiceManager\ServiceManager))
#2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(472): call_user_func(Array, Object(Zend\ModuleManager\Module in /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 302" while reading response header from upstream, client: 10.0.2.2, server: zf2.tutorial, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "zf2.tutorial:8000"
2013/05/03 18:34:35 [error] 8217#0: *4 FastCGI sent in stderr: "PHP Fatal error: Uncaught exception 'Zend\ServiceManager\Exception\InvalidArgumentException' with message 'Provided abstract factory must be the class name of an abstract factory or an instance of an AbstractFactoryInterface.' in /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:302
Stack trace:
#0 /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/Config.php(126): Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\Cache\Serv...')
#1 /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ModuleManager/Listener/ServiceListener.php(223): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\ServiceManager\ServiceManager))
#2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#3 /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/EventManager/EventManager.php(472): call_user_func(Array, Object(Zend\ModuleManager\Module in /var/www/zf2.tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php on line 302" while reading response header from upstream, client: 10.0.2.2, server: zf2.tutorial, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "zf2.tutorial:8000"
Aktualny VHost:
server {
listen 80;
server_name zf2.tutorial;
root /var/www/zf2.tutorial/public;
index index.php;
error_log /var/www/zf2.tutorial/error.log;
if (!-e $request_filename) {
rewrite ^.*$ /index.php last;
}
location ~ .php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param APPLICATION_ENV development;
fastcgi_param ZF2_PATH /var/www/zf2.tutorial/vendor/ZF2;
include fastcgi_params;
}
}