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

本文介绍如何从零开始搭建Nginx+PHP+MySQL(LAMP)环境,包括下载所需软件、配置Nginx使其能正确解析PHP文件,并连接到MySQL数据库。文章详细解释了每一步操作及所需配置。
1.下载软件
Nginx 下载地址:[url]http://nginx.org/download/nginx-0.8.17.zip[/url]
PHP 下载地址:[url]http://windows.php.net/downloads/releases/archives/php-5.3.3-Win32-VC6-x86.zip[/url]
MySQL 下载地址:[url]http://downloads.mysql.com/archives/mysql-5.0/mysql-noinstall-5.0.20-win32.zip[/url]
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
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值