简体   繁体   English

kohana和nginx问题/ php-fpm

[英]problems with kohana and nginx / php-fpm

I'm having issues getting kohana to come up at all. 我在让kohana出现问题上遇到了问题。 I'm somewhat new to nginx and it's configurations. 我对nginx有点陌生,它是配置。 It's a CentOS 5.6 box. 这是一个CentOS 5.6盒子。 The configuration file: http://pastie.org/2499212 配置文件: http : //pastie.org/2499212

I can get phpinfo() to return correctly or other static files. 我可以使phpinfo()正确返回或其他静态文件。 It appears to be choking on the rewrite rules. 重写规则似乎令人窒息。 BTW, This particular config works with another server and kohana. 顺便说一句,此特定配置可与另一台服务器和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. 没什么意义,因为您要匹配.php文件。 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. Kohana不能以这种方式工作,因为它处理的URL类似于/index.php/controller/action或/ controller / action,但都没有以.php结尾,因此与您的规则不匹配。

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. 如果需要,您可以使用另一个位置块来匹配.php文件,这样,您的webroot中就可以包含静态PHP文件。 My configuration is for when Kohana is in the webroot. 我的配置适用于Kohana在webroot中的情况。

Start off with a basic basic configuration ^ and see if works. 从基本的基本配置^开始,看是否可行。 If you need more help check out #nginx on Freenode. 如果您需要更多帮助,请在Freenode上查看#nginx。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM