使用最新的包安装后,使用./vhost.sh添加主机,使用了thinkphp的rewrite,但发现 使用U函数生成地址时出错,如U('hello'),地址应该是 /Home/Index/hello, 实际是/Home/Index/Home/Index/hello,搞不清楚为什么模块名和控制器名多输出了,
谢谢!
谢谢!
3 Answers
将虚拟主机配置文件/usr/local/nginx/conf/vhost/www.example.com.conf中:
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
改成如下:
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
重新加载nginx
service nginx reload
试试
Please login or Register to submit your answer