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文件
把
修改PHP.INI配置文件
启动PHP FastCgi,在CMD模式下输入
启动Nginx服务,即在CMD模式下输入
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
本文介绍如何从零开始搭建Nginx+PHP+MySQL(LAMP)环境,包括下载所需软件、配置Nginx使其能正确解析PHP文件,并连接到MySQL数据库。文章详细解释了每一步操作及所需配置。
1337

被折叠的 条评论
为什么被折叠?



