服务器安装使用的是oneinstack一键安装包,lnmpa(Linux + Nginx+ MySQL+ PHP+ Apache)https://oneinstack.com/
程序运行的是discuz3.2, http://www.liuxuesheng8.com/
在发表新帖子,提交时,出现错误,提示:
This page isn’t working
bbs.liuxuesheng8.com is currently unable to handle this request.
HTTP ERROR 500
但是内容确实已经写到数据库里,只是卡在上面图片所示页面,重新打开网站页面,发表的新帖子已经提交,很是奇怪。
然后查看服务器日志,只是在access_log里面出现,post 500错误,而在apache里面和openresty的日志里面都没有相应的错误日志,这种情况下在哪里查找500原因呢???
- - [29/Apr/2017:18:27:03 +0800] "POST /forum.php?mod=post&action=newthread&fid=70&extra=&topicsubmit=yes HTTP/1.0" 500 -
Obviously your error is related to nginx.
nginx appears 500, generally there are the following situations:
The hard disk space is full (df -lh checks the disk usage, the directory where nginx is located is 100% occupied). If the access log is enabled in nginx, it is best to close the access log when it is not needed. The access log takes up a lot of hard disk space.
nginx configuration file error
When configuring rewrite, 500 errors will occur if some rules are not handled properly. Check your own rewrite rules. If some variables in the configuration file are set improperly, a 500 error may also occur, such as referencing a variable with no value.
Concurrency problem, the server cannot handle it
The file open handle is too small. When doing server concurrency testing, due to the high pressure on the server, we often see that some of the requests are 500. The reason is that the file handle that nginx can use is too small. Each request will occupy a handle.
Turn on error output for apache and php.
In the apache, nginx, php error logs, there is nothing related to this post500 error,,, very strange
It’s possible what the 3rd floor said
Because the rewrite function is configured, sometimes when you open a post, rewrite does not take effect. It is still a dynamic web page. After clicking the link again, rewrite takes effect. . . The reason I guess is that after the post is submitted, the link needs to be rewritten, and the server cannot rewrite at this time, so it is stuck on the corresponding page, but the data has been written to the database
The php code may report an error, but if there is no configuration error output, it will also report a 500 error. You can try modifying the configuration to output PHP errors in log format.