win nginx php7 404_WIN 下nginx + php7 配置

下载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_nofile51200;

events {

worker_connections51200;

}

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_buffers416k;

gzip_http_version1.0;

gzip_comp_level2;

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_page500 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 {

listen80default_server;

server_name localhost;

root apps/www/;

index index.php index.html index.htm;

location~\.php$ {

fastcgi_pass127.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端口正常不。

c349b8c0aea69a428817905cba3053e2.png

实际上nginx 经过fastcgi 和PHP之间走的是TCP 因此判定;咱们的fastcgi 并无在工做;

(把php根目录下的php.ini-development 改为ini文件)

启动fastcgi

在根目录 php-cgi.exe -b 127.0.0.1:9000-c php.ini

咱们在看看端口状况

fe58334662fd34ec0051ab90e8dfda73.png

49ebf1ae5bed72397690c1c99eb29ebe.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值