What to do if nginx 500 error occurs under php

coldplay.xixi
Release: 2023-03-03 21:42:01
Original
3990 people have browsed it

php下nginx  500错误的解决办法:首先打开【limits.conf】文件,加入相关代码;然后在【worker_processes】后加入一行语句;最后重新启动nginx,重新载入设置即可。

What to do if nginx 500 error occurs under php

php下nginx  500错误的解决办法:

1 打开/etc/security/limits.conf文件,加上两句

代码如下:

* soft nofile 65535 
* hard nofile 65535
Copy after login

2 打开/etc/nginx/nginx.conf

worker_processes的下面增加一行

代码如下:

worker_rlimit_nofile 65535;
Copy after login

3 重新启动nginx,重新载入设置

代码如下:

kill -9 `ps -ef | grep php | grep -v grep | awk '{print $2}'` 
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 100 -u www-data -f /usr/bin/php-cgi 
killall -HUP nginx
Copy after login

重启后再看nginx的错误日志,也没有发现500报错的情况了。 

4、有可能是数据库问题我的在nginx日志php日志都没有发现什么问题, 最后发现数据库访问不了,修正后问题解决。

相关学习推荐:php编程(视频)

The above is the detailed content of What to do if nginx 500 error occurs under php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!