2-04 4,317 views
"运行环境"
实例平台:阿里云ECS
运行环境:CentOS release 6.6 (Final),Linux+Nginx(nginx/1.0.15)+Mysql(5.1.73)+PHP(5.3.3)
运行环境:CentOS release 6.6 (Final),Linux+Nginx(nginx/1.0.15)+Mysql(5.1.73)+PHP(5.3.3)
"步骤"
1.安装php-fpm, Linux 下 运行~ yum -y install php-fpm
2.启动fpm,~ service php-fpm start
3.开机启动fpm ~ chkconfig php-fpm –level 2345 on
4.配置nginx.conf ~ vi/vim /etc/nginx/nginx.conf 或者你自己定义的conf文件,加入下面的代码
2.启动fpm,~ service php-fpm start
3.开机启动fpm ~ chkconfig php-fpm –level 2345 on
4.配置nginx.conf ~ vi/vim /etc/nginx/nginx.conf 或者你自己定义的conf文件,加入下面的代码
server{
#省略以上代码
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
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$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
include fastcgi_params;
}
}
需要在thinkphp中开启伪静态模式