nginx+php环境搭建说明

来源:互联网 发布:2017中国贫富差距数据 编辑:程序博客网 时间:2024/05/19 22:56

Environment:

Windows 7

nginx 1.2.6

php 5.4.11

Configuration:

一、安装、配置PHP

1、下载PHP包并解压;

2、将解压目录里的php.ini-development复制至C:\Windows\下,并改名为php.ini;


二、安装、配置nginx

1、下载nginx installer包并安装;

2、修改conf/nginx.conf:

location / {  root   E:/www;  index  index.html index.htm index.php;  access_log E:/www/nginx.log;}location ~ \.php$ {  rootE:/www;  fastcgi_pass 127.0.0.1:9000;  fastcgi_index index.php;  include fastcgi_params;}

3、修改conf/fastcgi_params

在文件最后增加:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

三、启动PHP FastCGI服务

c:/php/php-cgi.exe -b 127.0.0.1:9000 -c c:/windows/php.ini

四、启动nginx

直接双击nginx.exe

五、测试




原创粉丝点击