xdebug 一直報錯 upstream timed out (110: Connection timed out) while reading response header from upstream


本地主機(Windows環境192.168.66.1)訪問虛擬機(192.168.66.139)里面的搭建的php環境(系統centos6.5版本,php版本是5.5.30 ,xdebug 2.4.0),通過命令行pecl install xdebug安裝的xdebug,

 

在php.ini配置xdebug

[Xdebug]
zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.auto_trace = On
xdebug.idekey = phpstorm
xdebug.remote_connect_back = On
xdebug.auto_trace = On
xdebug.show_exception_trace = On
xdebug.remote_autostart = On
xdebug.remote_enable = On
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = 1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.profiler_enable=On
xdebug.trace_output_dir = "/tmp/xdebug2222/"
xdebug.profiler_output_dir = "/tmp/xdebug/"
xdebug.remote_mode = req

反問頁面index.php,頁面一直卡死,查看nginx錯誤日志,發現一直有upstream timed out (110: Connection timed out) while reading response header from upstream

php-fpm一直報超時的錯誤,應該是php-fpm返回請求超過了設置的時間,但是一直不知道為什么會報錯,腳本也沒問題,

發現xdebug.remote_connect_back = On把這行注釋掉之后,就沒問題了,邪門啊。

官網地址:https://xdebug.org/docs/all_settings#remote_connect_back

官網給出的這個這個參數的解釋是

xdebug.remote_connect_back
Type: boolean, Default value: 0, Introduced in Xdebug > 2.1
If enabled, the xdebug.remote_host setting is ignored and Xdebug will try to connect to the client that made the HTTP request. It checks the $_SERVER['REMOTE_ADDR'] variable to find out which IP address to use. Please note that there is no filter available, and anybody who can connect to the webserver will then be able to start a debugging session, even if their address does not match xdebug.remote_host.

大概意思是,設置了這個參數之后,xdebug返回數據時就不會只返回給xdebug.remote_host參數設置的IP了,任何ip請求都會返回數據,這樣就可以多人共享這台服務器的php xdebug環境了。

不過還是沒知道解決辦法,不知道為什么。。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM