php下nginx 500错误的解决办法:首先打开【limits.conf】文件,加入相关代码;然后在【worker_processes】后加入一行语句;最后重新启动nginx,重新载入设置即可。
php下nginx 500错误的解决办法:
1 打开/etc/security/limits.conf文件,加上两句
代码如下:
* soft nofile 65535 * hard nofile 65535
2 打开/etc/nginx/nginx.conf
在worker_processes
的下面增加一行
代码如下:
worker_rlimit_nofile 65535;
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
重启后再看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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version
Recommended: Win version, supports code prompts!

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver CS6
Visual web development tools

Atom editor mac version download
The most popular open source editor
