問題描述
我希望使用不同計算機的團隊能夠在遠程服務器上調試 PHP,但是我很難讓 Xdebug 在 NetBeans 7.0.1 中工作.我嘗試了很多在線提示,但都無濟于事.
作為記錄,我已經在運行 WampServer 的 Windows 7 機器上成功地本地安裝了 Xdebug.所以我可以在 NetBeans 中使用斷點調試 PHP,前提是我將 Project Properties->Run Configuration->Run As 屬性設置為 Local Web Site.但是,如上所述,我的目標是在 遠程網站 上的 NetBeans 中進行調試.
我的服務器是 Ubuntu 11.04 機器.我使用了
因此,您需要相應地設置服務器,方法是告訴它連接到特定 IP 地址(xdebug.remote_host
)或自動重新連接"" (xdebug.remote_connect_back
).不過,后者有一些安全隱患.這些在手冊中有概述.
I want a team using different computers to be able to debug PHP on a remote server, but I am having a hard time getting Xdebug to work in NetBeans 7.0.1. I’ve tried many online tips, but to no avail.
For the record, I have successfully installed Xdebug locally on a Windows 7 machine running WampServer. So I can debug PHP with breakpoints in NetBeans, provided I set the Project Properties->Run Configuration->Run As property to Local Web Site. However, as stated above my goal is to debug in NetBeans on a Remote Web Site.
My server is a Ubuntu 11.04 machine. I have used the output from http://www.xdebug.org/find-binary.php to put the proper binary on the machine. I have modified all php.ini
files I could find (in both the php5/apache2
and php5/cli
directories) to include these lines:
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
If I check the phpinfo.php
web page, it says:
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
So Xdebug does seem to be installed properly. Still, when I try debugging in NetBeans, I get the endless status bar message Waiting For Connection (netbeans-xdebug). When I hit the stop button I get No connection from xdebug was detected within X seconds. The reason could be that xdebug is not installed or not properly configured.
Maybe I'm confusing local settings with server settings here? A post said xdebug.remote_host
should be set to the IP of the machine running NetBeans, but I want a team to be able to debug using machines with different IP addresses. A problem could be port 9000, but I have checked that it is not blocked.
Any help that could clarify this would be appreciated!
The server running PHP (and XDebug) needs to be able to connect to your workstation/desktop.
So you'll need the server set up accordingly by either telling it to connect to a specific IP-address (xdebug.remote_host
) or to automatically "connect back" (xdebug.remote_connect_back
). The latter has some security implications, though. These are outlined in the manual.
這篇關于遠程服務器的 Xdebug 未連接的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!