问题
I'm using xdebug to debug some code for my company. Sometimes I'm debugging something and the debugging time expires and i need to restart the whole process of debugging.
I have tried putting xdebug.remote_cookie_expire_time = 36000
in the php.ini
file to extend the session to 10 hours but i don't think this is helping.
I think i should mention that I'm trying to debug on chrome.
回答1:
connection 1: read ECONNRESET
The above tells that connection was terminated by a web server/proxy but not Xdebug itself. Extremely likely it will be your web server.
When you debug a web page, that script is still getting executed in eyes of the web server (the execution is paused just for you). If web server sees that some process/handler that it manages runs more than max duration time limit, it will simply kill it (to ensure that no resources wasted on hang up handler or whatnot).
Check your web server settings and look at "timeout" kind of options. Possible settings name depends on how you run your PHP: php-fpm, FastCGI or Apache module perhaps.
P.S. Please note that such timeout is not applicable when debugging via CLI (as there is no "parent watcher process" in such case). So if you can -- try debugging your code this way (depends on your code/how it's written of course).
For IIS, for example, you can find a solution in this old PhpStorm forum thread -- check very last comment.
- Launch IIS Manager
- Go to
FastCGI Settings
- Select your PHP installation, Right click -> Edit...
- Now increase values for these parameters:
Activity Timeout
andRequest Timeout
(I'm not sure if both are actually required, but that's what I did).
This will prevent IIS from killing PHP scripts too early. You will have like 700 seconds (over 11 minutes) if you do similar setup (see my screenshot):
来源:https://stackoverflow.com/questions/58484553/how-do-i-extend-my-xdebug-session-time