How do i extend my Xdebug “session time”?

跟風遠走 提交于 2021-02-11 13:32:57

问题


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.

  1. Launch IIS Manager
  2. Go to FastCGI Settings
  3. Select your PHP installation, Right click -> Edit...
  4. Now increase values for these parameters: Activity Timeout and Request 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!