Я использую мой MacBook Pro (OSX 10.6.7) в качестве сервера разработки с этой конфигурацией
nginx 0.8.54_0
php5 @5.3.6_0+fastcgi
fcgi @2.4.0_3
spawn-fcgi @1.6.3_0
мой CI равен 1.7.2 и 1.7.3
моя структура каталоговВот как это
my document root is /Users/nuri/Sites
my CI system located in /Users/nuri/frameworks/CI/system
my CI application located in /Users/nuri/project/apps1/application
проблема в том, что nginx ничего не возвращал и не печатал при доступе к каким-либо контроллерам CI, которые я тестировал с использованием apache из пакетов MAMP, контроллеры работают нормально
пример доступа к index.php/ welcome
из лог-файла CI, Nginx, кажется, останавливается в этом состоянии
DEBUG - 2011-04-07 20:39:36 --> Config Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Hooks Class Initialized
DEBUG - 2011-04-07 20:39:36 --> URI Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Router Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Output Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Input Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Global POST and COOKIE data sanitized
DEBUG - 2011-04-07 20:39:36 --> Language Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Loader Class Initialized
DEBUG - 2011-04-07 20:39:36 --> Helper loaded: form_helper
DEBUG - 2011-04-07 20:39:36 --> Helper loaded: url_helper
DEBUG - 2011-04-07 20:39:36 --> Database Driver Class Initialized
при доступе через apache, в журнале говорится:
DEBUG - 2011-04-07 20:40:09 --> Config Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Hooks Class Initialized
DEBUG - 2011-04-07 20:40:09 --> URI Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Router Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Output Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Input Class Initialized
DEBUG - 2011-04-07 20:40:09 --> XSS Filtering completed
DEBUG - 2011-04-07 20:40:09 --> XSS Filtering completed
DEBUG - 2011-04-07 20:40:09 --> Global POST and COOKIE data sanitized
DEBUG - 2011-04-07 20:40:09 --> Language Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Loader Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Helper loaded: form_helper
DEBUG - 2011-04-07 20:40:09 --> Helper loaded: url_helper
DEBUG - 2011-04-07 20:40:09 --> Database Driver Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Session Class Initialized <-------- missing this line below <<<
DEBUG - 2011-04-07 20:40:09 --> Helper loaded: string_helper
DEBUG - 2011-04-07 20:40:09 --> Session routines successfully run
DEBUG - 2011-04-07 20:40:09 --> User Agent Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Controller Class Initialized
DEBUG - 2011-04-07 20:40:09 --> Final output sent to browser
DEBUG - 2011-04-07 20:40:09 --> Total execution time: 0.0582
я пытаюсьчтобы обнаружить ловушки, я обнаружил, что CI + nginx «не обрабатывает» ничего из system / codeigniter / CodeIgniter.php, начиная со строки
$CI = new $class();
, он отлично работает с apache, по крайней мере, я мог бы напечатать_ $ значение CI
пожалуйста, отчаянно нужна помощь эксперта здесь
моя конфигурация сервера nginx
server {
listen 8080;
server_name jupiter;
index index.php index.html index.htm;
root /Users/nuri/Sites;
access_log /tmp/jupiter.access.log webalizer;
error_log /tmp/jupiter.error.log debug;
client_max_body_size 5m;
client_body_buffer_size 256k;
#error_page 404 /index.php;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
error_page 404 /40x.html;
location = /50x.html {
root /opt/local/html;
}
location = /40x.html {
root /opt/local/html;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
#expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
break;
}
location ^/project/apps1/ {
if (!-e $request_filename) {
rewrite ^/project/apps1/(.*)$ /project/apps1/index.php/$1 last;
}
}
location /project/apps1/index.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /Users/nuri/Sites/project/apps1/index.php;
include /opt/local/etc/nginx/fastcgi_params;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /opt/local/etc/nginx/fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
}