0

我使用 phalcon-dev-tools-v2.0.13 创建了一个名为的项目test,我访问了 root url "/",它起作用了!然后,我更改了一些代码,如下所示: 在此处输入图像描述

有效!

在此处输入图像描述

但:

在此处输入图像描述

我添加了另一个网址,它不起作用!

在此处输入图像描述

怎么了?我是 Phalcon 的新手,我关注了 Phalcon 的文档。我的系统是php5.6.30 Phalcon2.0.13nginxconf文件是:

server {
             listen      80;
             server_name test;
             root /Users/ryugou/test/public;
             index  index.php index.html index.htm;
             charset     utf-8;

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

    location ~ \.php$ {
         try_files     $uri =404;

         fastcgi_pass  127.0.0.1:9000;
         fastcgi_index /index.php;

         include fastcgi_params;
         fastcgi_split_path_info       ^(.+\.php)(/.+)$;
         fastcgi_param PATH_INFO       $fastcgi_path_info;
         fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      }

     location ~ /\.ht {
         deny all;
     }
}
4

1 回答 1

2

您的问题出在 nginx 配置文件上。您没有在位置块上传递 _url-

将位置块修改为(小心最后一部分)-

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

检查Phalcon Nginx 配置

于 2017-04-17T16:26:03.997 回答