search

Home  >  Q&A  >  body text

(Linux + Nginx + MySQL + PHP + Apache) 500 error occurs in post

The server installation uses oneinstack one-click installation package, lnmpa (Linux + Nginx + MySQL + PHP + Apache) https://oneinstack.com/

The program runs discuz3.2, http://www.liuxuesheng8.com/

When publishing a new post and submitting it, an error occurred, prompting:

This page isn’t working

bbs.liuxuesheng8.com is currently unable to handle this request.
HTTP ERROR 500

< /p>

But the content has indeed been written to the database, but it is stuck on the page shown in the picture above. When I reopen the website page, the new post has been submitted, which is very strange.
Then check the server log, it only appears in the access_log, post 500 error, but there is no corresponding error log in apache and openresty logs, in this case Where can I find the reason for 500? ? ?

 - - [29/Apr/2017:18:27:03 +0800] "POST /forum.php?mod=post&action=newthread&fid=70&extra=&topicsubmit=yes HTTP/1.0" 500 -

< /p>

phpcn_u1582phpcn_u15822808 days ago1565

reply all(4)I'll reply

  • ringa_lee

    ringa_lee2017-05-16 13:08:00

    Obviously your error is related to nginx.

    nginx appears 500, generally there are the following situations:

    1. 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.

    2. 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.

    3. 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.

    reply
    0
  • 某草草

    某草草2017-05-16 13:08:00

    Turn on error output for apache and php.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:08:00

    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

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:08:00

    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.

    reply
    0
  • Cancelreply