Ask for advice! HTTP ERROR 500 error, no prompts on the console. How to quickly lock the error location of the code?
小小的菜
小小的菜 2018-04-23 11:50:36
0
2
1308

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?

小小的菜
小小的菜

reply all(1)
legend

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 Thank you for sharing your valuable experience
    小小的菜 author 2018-04-24 23:15:09
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template