五、整合nginx和php5
1.编辑/etc/nginx/nginx.conf,启用如下选项(65-71行)
- location ~ \.php$ {
- root html;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- include fastcgi_params;
- }
2.在所支持的主页面格式中添加php格式的主页,类似如下:
- location / {
- root html;
- index index.php index.html index.htm;
- }
- //修改
- fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- //为
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3.而后重新载入nginx的配置文件进行测试。
- # service nginx reload
在/usr/html新建index.php的测试页面,测试php是否能正常工作
- # cat > /usr/html/index.php <<EOF
- <?php
- phpinfo();
- ?>
接着就可以通过浏览器访问此测试页面了。
可以看到此时的zned版本,这个是不支持shopex安装的。



