时间:2021-07-01 10:21:17 帮助过:18人阅读
?
?
下载php,地址:http://www.php.com/downloads.php如图

先在E盘创建一个名叫“wnmp”的文件夹,然后把PHP解压到改文件下。

?
?
extension_dir = "ext" date.timezone = Asia/ChongQing?
因为nginx需要cgi方式的php,所以还需要更改一下几处内容
enable_dl = On cgi.force_redirect = 0 cgi.fix_pathinfo=1 fastcgi.impersonate = 1 cgi.rfc2616_headers = 1
?到这里PHP配置告一段落,接着配置nginx。
?
nginx -s reload //重启Nginx nginx -s stop //暂停 nginx -s quit //退出nginx start nginx //启动?然后在浏览器的地址栏中输入127.0.0.1出现一下界面,说明nginx启动正常
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost; #本地IP
root E:/wnmp/www; #存放网站的根目录
location / {
index index.php index.html index.htm; #添加index.php。
#autoindex on;#如果文件不存在列出目录结构;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000; #fastcgi及监听的端口与php的cgi启动时要一致
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
??