开发者

problems with kohana and nginx / php-fpm

开发者 https://www.devze.com 2023-04-03 14:18 出处:网络
I\'m having issues getting kohana to come up at all. I\'m somewhat new to nginx and it\'s configuratio开发者_如何学Gons.

I'm having issues getting kohana to come up at all. I'm somewhat new to nginx and it's configuratio开发者_如何学Gons. It's a CentOS 5.6 box. The configuration file: http://pastie.org/2499212

I can get phpinfo() to return correctly or other static files. It appears to be choking on the rewrite rules. BTW, This particular config works with another server and kohana. Thanks in advance for any help.


This line in your configuration

# PHP FILES MIGHT BE TO HANDLED BY KOHANA
try_files $uri $uri/ @kohana;

doesn't make much sense because you're matching against .php files. Kohana doesn't work that way though as it handles URLs which are either like /index.php/controller/action or /controller/action, neither end in .php and thus don't match your rule.

This configuration should work for you:

location /
{
    try_files $uri /index.php?$args;
}

location = /index.php
{
    include fastcgi.conf;
    fastcgi_param KOHANA_ENV production;
    fastcgi_pass php-nolimits-staging;
    track_uploads proxied 30s;
}

You can have another location block to match against .php files if you wish, that way you can have static PHP files in your webroot. My configuration is for when Kohana is in the webroot.

Start off with a basic basic configuration ^ and see if works. If you need more help check out #nginx on Freenode.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号