1)安裝vc++運作庫
2)安裝mysql
3)解壓php,修改配置檔案
4)解壓nginx 修改配置檔案
location / {
root html;
index index.html index.htm;
}
更改root目錄,添加index.php
location / {
root D:/WNMP/nginx/html;
index index.html index.htm index.php;
}
修改大概在第63-71行的
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#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;
#}
更改root目錄,更改/scripts為$document_root
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root D:/WNMP/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
切換到php目錄,執行如下指令運作php,如果出現找不到msvcr110.dll的情況,請自行下載下傳安裝VC++2012運作庫
D:
cd D:\WNMP\php
php-cgi.exe -b 127.0.0.1:9000-c D:\WNMP\php\php.ini
(3).切換到nginx目錄,重新開機nginx.exe,
D:
cd D:\WNMP\nginx
nginx -s reload