huanglong
这个很简单,你按着我的配置来即可。
server { charset utf-8; client_max_body_size 128M; listen 80; server_name local.yii2test.com index index.php index.html index.htm; root /usr/local/nginx/html/yii2test/web; location ~ \.php$ { root /usr/local/nginx/html/yii2test/web; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } #yii框架使用代码 location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php?$args; } location ~ /\.ht { deny all; } }
上面我给你做了一个虚拟域名,你按着我的配置就可以正常访问了。 url 最终是这样的 local.yii2test.com/index
改了也没用啊,只要我把 ?r= 这个一去掉,就报404
- huanglong 回复了 yuaishuang6106 的回答
你的那种方法路径是错的,递交到这个路径/index.php?r=index/index
这样写报错了:No input file specified.
- huanglong 2015-05-18 已签到连续签到1天,获得了5个金钱
- huanglong 2015-05-11 已签到连续签到1天,获得了5个金钱