加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 等待连接到XDEBUG的Netbeans

发布时间:2020-12-13 13:16:27 所属栏目:PHP教程 来源:网络整理
导读:Netbeans不会连接到xdebug.我试过以下帖子的建议: Debugging IDE’s port connection to XDebug: “Waiting to Connect” netbeans shows “Waiting For Connection (netbeans-xdebug)” 但它并没有解决我的问题. 似乎Netbeans连接到xdebug,因为在等待连接
Netbeans不会连接到xdebug.我试过以下帖子的建议:

Debugging IDE’s port connection to XDebug: “Waiting to Connect”

netbeans shows “Waiting For Connection (netbeans-xdebug)”

但它并没有解决我的问题.

似乎Netbeans连接到xdebug,因为在等待连接时,对Web服务器[Apache2]的所有请求都被阻止.端口[9001]似乎正在使用中:

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()中加载的]

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配置:

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仅在我关闭调试会话后打开页面.

我也禁用了SELinux

在Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4
我有同样的问题,并通过以下方式解决:
1.按照说明继续编译自己的xdebug.so
2.在netbean 7.4一般选项(对不起,我没有声望10发布图片)
测试连接.确保代理服务器上的设置正确:
对我说“没有代理人”正在运作.
3.在php选项调试选项卡中将xdebug设置端口更改为9001或9000以外的其他设置.
我选择9002,但你可以尝试,直到找到一个免费端口(如果端口不是免费的,请告诉你)
4.在php.ini中为/etc/php5/conf.d/20-xdebug.ini中的ubuntu用户

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. sudo service apache2 restart

这样做之后我可以再次调试php.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读