下载PHP7 javascript
下载nginxphp
(有可能遇到缺乏dll文件,在运行php 的exe时候)下载地址:https://git.oschina.net/bingoPureLife/Some-Files-very-useful/raw/master/vcruntime140.rarcss
让nginx工做起来:html
cd 到nginx根目录 start nginx 可是奇怪的是 nginx -s stop 并不能停掉nginxjava
我选择了杀进程nginx
tasklist /fi "imagename eq nginx.exe" git
找出相关的进程 一一杀掉 taskkill /f /pid xxx || taskkill /f /im nginx.exeapp
修改一下配置文件让咱们的nginx可以处理PHP请求;实际上咱们的nginx 不能解释PHP的atom
error_log logs/error.log error ; pid logs/nginx.pid; worker_processes auto; worker_rlimit_nofile 51200; events { worker_connections 51200; } http { client_body_buffer_size 32k; client_header_buffer_size 2k; client_max_body_size 2m; default_type application/octet-stream; log_not_found off; server_tokens off; include mime.types; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 2; gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/rss+xml application/xhtml+xml application/atom_xml; gzip_vary on; #error_page 500 502 503 504 /50x.html; log_format access '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; server { listen 80 default_server; server_name localhost; root apps/www/; index index.php index.html index.htm; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PHP_VALUE open_basedir=$document_root:/tmp/:/proc/; include fastcgi_params; } } include vhost/*.conf; }
而后发现结果处理PHP 请求失败了。fastcgi_pass 127.0.0.1:9000; 从这一句看,咱们nginx 直接会把php请求扔这里。而后再php那边调用php解释器spa
既然咱们PHP 请求502错误;timeout;
看看咱们的9000端口正常不。
实际上nginx 经过fastcgi 和PHP之间走的是TCP 因此判定;咱们的fastcgi 并无在工做;
(把php根目录下的php.ini-development 改为ini文件)
启动fastcgi
在根目录 php-cgi.exe -b 127.0.0.1:9000-c php.ini
咱们在看看端口状况