Windows下Nginx+PHP5(FastCgi)配置+MySQL5

1.下载软件
Nginx 下载地址: http://nginx.org/download/nginx-0.8.17.zip
PHP 下载地址: http://windows.php.net/downloads/releases/archives/php-5.3.3-Win32-VC6-x86.zip
MySQL 下载地址: http://downloads.mysql.com/archives/mysql-5.0/mysql-noinstall-5.0.20-win32.zip
2.配置Nginx主要是nginx.conf文件
location / {
    #root   html;
    #index  index.html index.htm;
    root d:/web;
    index  index.html index.htm index.php;
}

#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;
#}
去处#并添加WEB目录
location ~ \.php$ {
    root           d:/web;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  d:/web$fastcgi_script_name;
    include        fastcgi_params;
}

修改PHP.INI配置文件
cgi.fix_pathinfo = 1

启动PHP FastCgi,在CMD模式下输入
RunHiddenConsole D:/dev/php-5.3.3/php-cgi.exe -b 127.0.0.1:9000 -c D:/dev/php-5.3.3/php.ini

启动Nginx服务,即在CMD模式下输入
X:/nginx-0.8.17/nginx.exe

猜你喜欢

转载自xml.iteye.com/blog/1709855
今日推荐