技术解析
环境:阿里云 ubuntu 14.04 nginx 1.8.0 php 5.5.9 , 有虚拟主机,已经安装多个应用
安装 weiphp 的时候,查了很多,得知 nginx 不支持 phpinfo,rewrite,,,也不太懂。然后安装的时候可以打开安装页面,但是点击同意协议的时候,跳转路径不正常:
http://xx.cn.php/?s=/install/step1.html(但是如果手动改成 http://xx.cn/install.php?s=/install/step1.html 的话就可以看到检测环境页面,只不过下一步也失败)
情况就是这样,求教...大概设置了一下本应用的配置文件如下:
server {
listen 80;
server_name xx.cn www.xx.cn;
root /var/www/xx/html/;
index index.php index.html index.htm;
access_log /var/www/xx/logs/access.log;
error_log /var/www/xx/logs/error.log;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.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 /var/www/xx/html$fastcgi_script_name;
fastcgi_param SCRIPT_NAME 抗投诉服务器$real_script_name;
fastcgi_param PATH_INFO $path_info;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 16k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_read_timeout 240;
}