ITeye博客

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

cjx186 · 2012-10-31 22:42 · 系统运行环境 · 非技术 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。