kohana 3.2 + php-fpm + nginx 404

问题描述 投票:0回答:1

我有一个旧的kohana应用程序,我正在尝试将其放在VPS上,但似乎无法正常运行。我已经花了几个小时在谷歌上搜索并查看缓存的论坛答案。我已经尝试了所有,似乎没有任何工作。诚然,我不知道如何处理nginx。我的应用程序的本地版本与apache兼容。我距离仅取消我的linode帐户并获得共享托管仅一步之遥!请让我离开这个壁架。

我的VPS使用php5-fpm和nginx 1.4.6运行Ubuntu 14.04 LTS。我正在从用户目录提供所有服务。

我的Nginx网站可用文件:

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;

    root /home/gabreal/Sites/public;
    index index.html index.htm index.php;

    # Make site accessible from http://localhost/
    server_name localhost;

    location / {
        try_files $uri $uri/ @kohana =404;
    }

    error_page 404 /404.html;

    # redirect server error pages to the static page /50x.html
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        # With php5-fpm:
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location @kohana {
        rewrite ^/(.+)$ /index.php$request_uri last;
    }
    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    location ~ /\.ht {
        deny all;
    }
}

我的Kohana应用程序位于这样的目录中:

├──/home/gabreal/Sites/public/
│   ├── horizons/
│   │   ├── grader/ (aka the kohana application)
│   │   │   ├── index.php
│   │   │   ├── application/
│   │   │   ├── system/

[当我通过转到http://example.com/horizons/grader访问该应用程序时,将加载kohana引导程序文件,并调用所有重定向。例如,我的默认路由会将您重定向到起始页。如果您尚未登录,请转到“用户/登录”。网址设置正确。转到上面的URL,浏览器将重定向到http://example.com/horizons/grader/user/login,但我得到nginx 404页面

以某种方式controller/action模式不适用于此Nginx设置。

请为爱这个世界上所爱的人提供帮助。

UPDATE

仅供参考,我安装了phpmyadmin,它运行正常。我仍然无法让kohana工作...

UPDATE 2

我重新安装了kohana,并尝试设置一些基本控制器。只有默认控制器的工作方式与我的应用程序相同。因此,转到我的应用程序的基本URL总是可以,但是直接转到任何/ controller / action / id类型的资源都会在全新安装和现有应用程序上给我[[nginx 404错误。 >

我有一个旧的kohana应用程序,我正在尝试将其放在VPS上,但似乎无法正常运行。我已经花了几个小时在谷歌上搜索并查看缓存的论坛答案。我已经尝试了全部,似乎什么也没有...
php nginx kohana
1个回答
2
投票
您正在使用的nginx配置不再被视为将PHP执行传递回FPM的正确方法。以下示例(根据WordPress documentation的原始部分和稍有修改的部分,

UPDATE 2020中的更新

© www.soinside.com 2019 - 2024. All rights reserved.