1. 程式人生 > >phpstorm+xdebug remote debug 無法進入斷點問題

phpstorm+xdebug remote debug 無法進入斷點問題

晚上搞了個虛擬機器的php環境,remote debug一直無法進斷點。網上各種查基本無果。最後自己解決了,這裡記錄一下,如果還有人碰到這個問題,可以嘗試下我的方法。

我的配置

php版本:5.5.14
xdebug版本:v2.5.4
phpstorm版本:2017.1.4

xdebug配置
zend_extension=/usr/local/php-55/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_enable=true
;注意這個autostart很關鍵,我就是加了這個才跑起來的
xdebug.remote
_autostart=1 ;這個是跑phpstorm的開發機 xdebug.remote_host=192.168.12.1 ;反向連線zend studio使用的埠 xdebug.remote_port=9000 ;用於zend studio遠端除錯的應用層通訊協議 xdebug.remote_handler=dbgp ;在phpstorm中的idekey配置成www xdebug.idekey=www ;這裡可以看到xdebug的日誌 xdebug.remote_log=/var/xdebug.log

總的來說,就是配置autostart和remote_host,這樣做的弊端就是隻能debug一臺開發機,但因為我這裡是自己電腦的虛擬機器,所以不是問題。另外說下容易踩的坑:
1、phpstorm中xdebug的埠要和伺服器環境一致;
2、注意IDEKey;
3、如果是remote debug,需要配置目錄對映;

如果上面幾個你看不懂,說明對phpstorm中xdebug的remote debug你還沒琢磨夠,繼續查資料吧…