問題描述
Netbeans 不會連接到 xdebug.我嘗試了以下帖子中的建議:
Netbeans won't connect to xdebug. I've tried suggestions from the following posts:
調試IDE到XDebug的端口連接:"等待連接
netbeans 顯示等待連接 (netbeans-xdebug)"
但它不能解決我的問題.
but it doesn't fix my issue.
似乎 Netbeans 連接到 xdebug,因為當它等待連接時,所有對網絡服務器 [Apache2] 的請求都被阻止.此外,端口 [9001] 似乎正在使用中:
It seems Netbeans connects to xdebug because while it waits for the connection all request made to the webserver [Apache2] are blocked. Also the port [9001] appears to be in use:
roxy@Pixy011 ~ $ sudo nmap -sS -O 127.0.0.1
Starting Nmap 6.00 ( http://nmap.org ) at 2013-11-28 20:48 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000029s latency).
Not shown: 990 closed ports
PORT STATE SERVICE
22/tcp open ssh
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
631/tcp open ipp
902/tcp open iss-realsecure
3306/tcp open mysql
8080/tcp open http-proxy
8081/tcp open blackice-icecap
9001/tcp open tor-orport <---- Opened by java
xdebug.ini: [我已經確認它已加載到 phpinfo()]
xdebug.ini: [I have confirmed it is loaded in phpinfo()]
zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9001
xdebug.idekey="netbeans-xdebug"
Netbeans 配置:
Netbeans configuration:
Debugger port: 9001
Session ID: netbeans-xdebug
Stop at first line: Checked
All other options are unchecked
項目屬性:
Host: 127.0.0.1
Port: 9001
我注意到 Netbeans 沒有將 XDEBUG_SESSION_STOP 附加到 URL.我認為這與問題無關,因為 Netbeans 僅在我關閉調試會話后才打開頁面.
I've noticed Netbeans doesn't append the XDEBUG_SESSION_STOP to the URL. I don't think this is related to the issue because Netbeans only opens the page after I close the debugging session.
我也禁用了 SELinux
I've also disabled SELinux
推薦答案
On Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4
我有同樣的問題并已通過以下方式解決:
1. 繼續 http://xdebug.org/wizard.php 按照說明編譯您自己的 xdebug.so
2. 在 netbean 7.4 中的常規選項(對不起,我沒有聲譽 10 發布圖片)測試連接.確保代理上的設置正確:對我來說無代理"正在工作.
3. 在 php 選項調試選項卡中將 xdebug 設置端口更改為 9001 或 9000 以外的端口.我選擇 9002 但你可以嘗試直到你找到一個空閑端口(如果端口不空閑請告訴你)
4. 在 php.ini OR 對于 ubuntu 用戶 在/etc/php5/conf.d/20-xdebug.ini
On Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4
I have same problem and have solve it by:
1. go on http://xdebug.org/wizard.php follow the instructions to compile your own xdebug.so
2. in netbean 7.4 general options (sorry I haven't reputation 10 to post image)
test connection. be sure correct settings on Proxy:
to me "No Proxy" is working.
3. in php options debugging tab change xdebug setting port to other than 9001 or 9000.
I choose 9002 but you can try until you find a free port (if port is not free nb tell you)
4. in php.ini OR for ubuntu users in /etc/php5/conf.d/20-xdebug.ini
zend_extension=/usr/lib/php5/20100525/xdebug.so #你把重新編譯的 xdebug.so 放在哪里
[xdebug]
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_port=9002 #你在上面的netbeans中找到的空閑端口
xdebug.remote_host=127.0.0.1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp/"
xdebug.idekey="netbeans-xdebug"
xdebug.remote_log="/home/#user_name#/xdebug.log" #您的用戶名
zend_extension=/usr/lib/php5/20100525/xdebug.so #where you ave put your reconpiled xdebug.so
[xdebug]
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_port=9002 # the port you have found free and set in netbeans above
xdebug.remote_host=127.0.0.1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp/"
xdebug.idekey="netbeans-xdebug"
xdebug.remote_log="/home/#user_name#/xdebug.log" #your user name
5.須藤服務 apache2 重啟
5. sudo service apache2 restart
這樣做后,我可以再次調試 php.
after do this I can debug php again.
這篇關于Netbeans 等待連接到 XDEBUG的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!