Zendアプリケーションを実行しようとしています。アプリケーションドキュメントのルート要求で404が表示されます。ユーザーログインページが見つかりません
この404は、サーバ404ページではなく、Zendフレームワークの/Application/view/errors/404.php
ページによってレンダリングされたものです。
このZendアプリケーションを実行するにはLinuxマシンにNginxとphp-fpmとMariaDBをインストールしました。
私はphpの実行をPHP Eclipse XDebugデバッガに接続しています。これは、index.phpページが実行されていることを示しており、そのZend\Mvc\Application::init
コールまでです。
// Setup autoloading
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
私はnginxのバーチャルホストを設定している:
$ cat programs/install/nginx/conf/sites-available/nginx-dev.extrapack.my-group.com
server {
listen 80;
server_name dev.extrapack.my-group.com;
root /home/stephane/dev/php/projects/my/Extrapack-Mon/public;
index index.php;
include /home/stephane/programs/install/nginx/conf/security;
access_log /home/stephane/programs/install/nginx/logs/access.log;
error_log /home/stephane/programs/install/nginx/logs/error.log notice;
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
access_log off;
log_not_found off;
expires max;
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_index index.php;
fastcgi_pass php5-fpm-sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS 'on'; # Make PHP-FPM aware that this vhost is HTTPs enabled
fastcgi_param APPLICATION_ENV development;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
}
client_max_body_size 20m;
client_body_buffer_size 128k;
}
/Application/config/module.config.php
ファイルが含まれています:
'application' => array(
'type' => 'Literal',
'options' => array(
'route' => '/application',
'defaults' => array(
'__NAMESPACE__' => 'Application\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
しかしIndexController
は全くヒットしていない、デバッガが停止しません。コントローラ内のブレークポイントのいずれかに移動します。
私はonBootstrap
コールバックでこのコードチャンクを追加しました:
$em->attach('dispatch.error', function($e){
switch ($e->getError()) {
case 'error-router-no-match':
break;
}
}, -100);
とデバッガがエラーがerror-router-no-match
1であることを意味、break;
行にブレークポイントで停止しません。私は助けるためにをご提供することができます他に何か分からないが、設定のいくつかの部分が欠落している場合のZendのnoobとして http://dev.extrapack.group.com/index.php?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=14776859837352
:ここ
は、デバッガがデバッグコンフィギュレーションを実行whenI要求しているURLです私の質問では、私はそれを追加してうれしいです。
私はZendバージョン2.4.9です。
EDIT:アプリケーションで最終的にユーザーのログインページを表示して問題を解決できるSSL仮想ホストを追加しました。
server {
listen 443;
server_name dev.extrapack.group.com;
root /home/stephane/dev/php/projects/Extrapack-Mon/public;
ssl on;
ssl_certificate /home/stephane/programs/install/nginx/conf/sites-available/extrapack.group.com.crt;
ssl_certificate_key /home/stephane/programs/install/nginx/conf/sites-available/extrapack.group.com.key;
location /simplesaml {
index index.php;
alias /usr/share/simplesaml/www;
location ~ ^/simplesaml/(module\.php)(/.+)$ {
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
fastcgi_split_path_info ^/simplesaml/(module\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME /usr/share/simplesaml/www/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_index index.php;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
}
}
location/{
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
fastcgi_split_path_info ^(.+\.php)(.*)$;
try_files $uri /index.php?$args;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS 'on'; # Make PHP-FPM aware that this vhost is HTTPs enabled
fastcgi_param APPLICATION_ENV development;
fastcgi_index index.php;
}
}
SSL仮想ホストを追加して問題を解決しました。しかし、私はまだ私の非SSL設定で何が間違っていたのか分からないことを認めなければなりません。 – Stephane