Impossible de charger ZF2 avec correct (?) Include_path

Donc, je suis toujours novice pour tout ce qui concerne Unix et maintenant je suis confronté à un problème qui me rend fou 🙂 Je demande aussi à mon ami, programmeur plus expérimenté, mais il ne peut pas trouver de réponse aussi. Donc, j’essaye de démarrer l’application zf2 basée sur zend-squelette avec nginx et php5-fpm.

$ sudo service nginx status * nginx is running $ sudo service php5-fpm status php5-fpm start/running, process 3389 $ ps aux | grep php root 3389 0.0 0.3 145520 13624 ? Ss 15:40 0:00 php-fpm: master process (/etc/php5/fpm/php-fpm.conf) www-data 3392 0.0 0.1 145520 4968 ? S 15:40 0:00 php-fpm: pool www www-data 3393 0.0 0.1 145520 5324 ? S 15:40 0:00 php-fpm: pool www somebud+ 3551 0.0 0.0 5908 840 pts/1 S+ 15:55 0:00 grep --color=auto php $ ps aux | grep nginx somebud+ 3172 0.5 0.6 184412 24944 ? Sl 15:33 0:07 gedit /etc/nginx/nginx.conf root 3368 0.0 0.0 15196 1092 ? Ss 15:40 0:00 nginx: master process /usr/sbin/nginx www-data 3369 0.0 0.0 15720 2080 ? S 15:40 0:00 nginx: worker process www-data 3370 0.0 0.0 15376 1516 ? S 15:40 0:00 nginx: worker process www-data 3371 0.0 0.0 15376 1516 ? S 15:40 0:00 nginx: worker process www-data 3372 0.0 0.0 15376 1516 ? S 15:40 0:00 nginx: worker process somebud+ 3554 0.0 0.0 5908 840 pts/1 S+ 15:55 0:00 grep --color=auto nginx 

Ceci est mon /etc/nginx/sites-available/testing.dom

 server { listen 80; server_name testing.dom; root /var/www/testing.dom/public_html/CommunicationApp/public/; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ .*\.(php|phtml)?$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param APPLICATION_ENV development; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; } location ~ .*\.(git|jpg|jpeg|png|bmp|swf|ico)?$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 1h; } location ~ /\.ht { deny all; } } 

Mon include_path se trouve dans /etc/php5/fpm/php.ini comme ceci:

 ; UNIX: "/path1:/path2" include_path = ".:/usr/share/php:/var/www/testing.dom/public_html/library/Zend" 

C’est quoi dans ce dossier Zend:

 $ sudo ls /var/www/testing.dom/public_html/library/Zend/ Authentication Code Db Escaper Filter InputFilter Log Mime Paginator Server Stdlib Uri XmlRpc Barcode Config Debug EventManager Form Json Mail ModuleManager Permissions ServiceManager Tag Validator Cache Console Di Feed Http Ldap Math Mvc ProgressBar Session Test Version Captcha Crypt Dom File I18n Loader Memory Navigation Serializer Soap Text View 

Ce dossier de bibliothèque est-il correct?

Et ceci est mon /var/www/testing.dom/public_html/CommunicationApp/public/index.php

 chdir(dirname(__DIR__)); $temp = get_include_path(); var_dump($temp); // Decline static file requests back to the PHP built-in webserver if (php_sapi_name() === 'cli-server' && is_file(__DIR__ . parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH))) { return false; } // Setup autoloading require '../CommunicationApp/init_autoloader.php'; // Run the application! Zend\Mvc\Application::init(require 'config/application.config.php')->run(); 

Donc, si j’entre test.dom dans le navigateur, j’ai encore ceci:

 ssortingng(62) ".:/usr/share/php:/var/www/testing.dom/public_html/library/Zend" 

Et rien d’autre.

Et c’est nginx error.log:

 2014/10/17 16:11:29 [error] 3369#0: *8 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.' in /var/www/testing.dom/public_html/CommunicationApp/init_autoloader.php:53 Stack trace: #0 /var/www/testing.dom/public_html/CommunicationApp/public/index.php(17): require() #1 {main} thrown in /var/www/testing.dom/public_html/CommunicationApp/init_autoloader.php on line 53" while reading response header from upstream, client: 127.0.0.1, server: testing.dom, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "testing.dom" 

Le problème a été résolu! Si vous avez un tel casse-tête, essayez de définir votre ZF2_PATH dans fastcgi_params comme ceci:

 fastcgi_param ZF2_PATH /var/www/testing.dom/public_html/library/;