dosrmo0442 2015-10-21 04:00
浏览 54

Kohana没有工作。 找不到课程。 Nginx + php-fpm。 数字海洋

Ubuntu 14.04 + nginx + php-fpm (php 5.5.9) Kohana 3.3.4

Url: http://188.166.65.233/ ErrorException [ Fatal Error ]: Class 'HTTP_Exception' not found

Not finding the model classes, controllers ... nothing The error is caused by the fact that Kohana does not see the Controller_Sites, although it is in the folder. On the site of the local machine works fine

==== Config:

php.ini is default, but: cgi.fix_pathinfo=1

nginx site-available default:

server {
    listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default ipv6only=on; ## listen for ipv6

    root /var/www/martds.ru;
    index index.html index.php index.htm;

    server_name martds.ru www.martds.ru;

    location / {
        try_files $uri $uri/ /index.php?q=$uri&$args;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-for $remote_addr;
        proxy_set_header Host $host;

        # try_files $uri $uri/ =404;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    location ~ /\.ht {
        deny all;
    }

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    location ~ \.php$ {
        try_files $uri $uri/ /index.php?q=$uri&$args;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;

        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;

        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
    }

    location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ {
        root /var/www/martds.ru;
        index index.html index.php;
        access_log off;
        expires 30d;
    }

    location ~* ^/(?:modules|system)\b.* {
            rewrite ^(.+)$ /index.php$1 permanent;
        }

    location ~ /\.ht {
        deny all;
    }
}
  • 写回答

1条回答 默认 最新

  • douchendan0040 2016-01-14 09:28
    关注

    The problem indeed was in cgi.fix_pathinfo=1

    DigitalOcean has cgi.fix_pathinfo=0 by default in php.ini, set it back to 1 and everything worked.

    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向