php-fpm哪里下载_centos – Nginx PHP-FPM提供.php文件作为下载

这是一个问了一千次的问题,因为我讨厌写帖子,所以我会阅读并搜索所有可能的文档,然后才能找到写作的烦人部分(对我来说).

所以我有Nginx& PHP-FPM启动并运行CentOS 7.2. PHP-FPM正在使用www.conf中正确声明的/var/run/php-fpm/php-fpm.sock:

; The address on which to accept FastCGI requests.

; Valid syntaxes are:

; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on

; a specific port;

; 'port' - to listen on a TCP socket to all addresses on a

; specific port;

; '/path/to/unix/socket' - to listen on a unix socket.

; Note: This value is mandatory.

listen = /var/run/php-fpm/php-fpm.sock

这是我的mywebsite.conf:

server {

listen 80;

server_name www.mywebsite.net;

# note that these lines are originally from the "location /" block

root /usr/share/nginx/html;

index index.php index.html index.htm;

location / {

try_files $uri $uri/ =404;

}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root /usr/share/nginx/html;

}

location ~ \.php${

try_files $uri =404;

fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;

fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

我在php.ini中也有cgi.fix_pathinfo = 0.

我重新启动/重新加载了Nginx和PHP-FPM服务,重新启动了整个服务器,什么也没得到.我无法显示.php文件,它们只是下载.

我错过了什么?

提前致谢.

解决方法:

Nginx配置中是否还有其他服务器块,尤其是listen 80 default或default_server指令?

还尝试将access_log和error_log添加到Nginx配置,以找出是否有任何访问该服务器的任何错误.

标签:php,nginx,centos

来源: https://codeday.me/bug/20190814/1658459.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值