search

Home  >  Q&A  >  body text

php - A 500 error occurred during the post request. Where can I find the cause? There is no corresponding log in the error_log in the background.

A 500 error occurred during the post request. Where can I find the cause? I looked at the error_log in the background and there is no corresponding log



天蓬老师天蓬老师2794 days ago1085

reply all(11)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 13:04:30

    Add
    in the entry file forum.php

    ini_set('display_errors','On');
    error_reporting(E_ALL);

    This will print out the error stack

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 13:04:30

    The 500 error is basically the code, or the code is not comprehensive and does not consider the zero point.
    You can take a look at the error log of php.
    As for what you are talking about 后台的error_log, it is not very clear

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 13:04:30

    Start reporting errors at a glance, display_errors

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 13:04:30

    There should be an error stack below your Response这个tab, if not, in your entry file:

    <?php
    try {
        // any of your code
    } catch(Exception $e) {
        echo "Exception\n", $e.getTraceAsString();
    }

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:04:30

    1. Has the server received the client’s request?

    2. Is the client request received by the server correct?

    3. Use a tool to send the client’s request data directly to the server, and then track the server program or various logs on the server to see where the problem lies.

    4. If the server feeds back the correct result, then use a tool to push the result directly back to the client to see if the client received it correctly? And how does the client react?

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:04:30

    500 means an error occurred on the server side, there is no need to look for front-end problems

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:04:30

    The server is installed with lnmpa,,,,php,apache,nginx. I have read the corresponding errorlogs below, but there is no corresponding information about this 500 error

    Yes The maximum memory occupied by the script (memory_limit): 192M exceeds

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-16 13:04:30

    Enable PHP configuration to output PHP code errors in the form of logs. The generated error log files are generally in the root directory where the program is located.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 13:04:30

    Develop a good habit. When returning information (especially the return of API classes without front-end), be sure to use try and catch to handle it, and record exceptions in the log

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:04:30

    500 is an error in the code. Set breakpoints everywhere in the code and check. The most likely reason is that there is an error in the database connection, or there is an infinite loop in a certain part of the program!

    reply
    0
  • Cancelreply