search

Home  >  Q&A  >  body text

Ask for advice! HTTP ERROR 500 error, no prompts on the console. How to quickly lock the error location of the code?

34D3058D63B38B21523A21597E5B3941.png

As shown in the picture, this kind of error occurs during runtime. There is no specific error prompt on the console. How can I quickly find the error location in the code?

小小的菜小小的菜2449 days ago1317

reply all(2)I'll reply

  • oswell

    oswell2018-04-24 13:58:42

    Let me talk about my solution. I hope it will be helpful to the original poster.

    First check the logs of nginx or apache (see what your own server is). Check to see if there are any errors. If there are errors, resolve the corresponding errors.

    Then put a breakpoint in index.php (project entry). Determine whether the project can be accessed normally.

    Then you will see the wrong URL, find the corresponding controller, and breakpoint on the first line of the controller to see if it can be accessed. If it cannot be accessed normally, there is a problem before the controller is found. . If there is __construct. Just check if it's here.

    In short, break the point where you think there may be a problem and see if the program reports an error. If an error is reported, there is a problem before the breakpoint. If no error is reported, the problem is below the breakpoint.

    Find it step by step.

    reply
    1
  • 小小的菜

    Thank you for sharing your valuable experience

    小小的菜 · 2018-04-24 23:15:09
  • Cancelreply