I just set up the debugging environment of PHPStorm+xdebug during the day today, and I encountered various problems: ultra-slow response when accessing, ultra-fast response when accessing, but a blank page.
There are many ways to solve problem A, but there is always a solution; I think problem B is a thread problem, maybe it can be solved by debugging the configuration of php.ini, maybe not, it is difficult to explain clearly, the thread problem may need to be solved with xdebug version is related.
Solution
PHP.ini Find the memory_limit parameter and increase it!
Change a browser! I had been using Google Chrome to debug the program, and then it started to slow down until each page took 6 seconds to load. It was unbearable. Neither Firefox nor IE had this problem. (This method is very easy to use and can produce results immediately!)
Use xdebug.profiler_enable_trigger configuration to selectively run the xdebug function profiler.
The value of xdebug.remote_host should be consistent with the IP of your server. For example, if you access through localhost, write localhost here. If you access 127.0.0.1, write 127.0.0.1
Check if your xdebug.profiler_output_dir directory has reached several gigabytes? (After more than ten hours of continuous development of an e-commerce program, the xdebug files in the xdebug.profiler_output_dir directory may reach several gigabytes!)
It is best to turn off xdebug when it is not needed!
xdebug.remote_enable = 0
xdebug.profiler_enable = 0
xdebug.remote_autostart = false
Finally, one sentence: DON’T RUN XDEBUG ON PRODUCTION.