我在Amazon EC2云中的“Amazon
Linux”(Centos派生的)32位实例上运行XAMPP 1.7.3a.我下载/构建/安装了XDEBUG 2.1.0. PHPinfo()输出中的相关项看起来像这样:
Directive Local Value Master Value
xdebug.idekey ECLIPSE_DBGP ECLIPSE_DBGP
xdebug.default_enable On On
xdebug.remote_autostart On On
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host 127.0.0.1 127.0.0.1
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.remote_log /opt/lampp/logs/xdebug_log
/opt/lampp/logs/xdebug_log
我使用PuTTY版本0.60中的SSH客户端从运行XP SP3的Windows笔记本电脑访问Linux机器.另外在笔记本电脑上我安装了Eclipse PDT(Helios Service Release 1 Build id:20100917-0705),我想我已经正确配置了使用端口9000进行XDEBUG远程调试.我说我想,因为我’我们很难弄清楚如何做到这一点,以及如何使用Eclipse PDT.但我确实设法配置并使用端口9000对使用XAMPP for Windows 1.7.3在localhost(127.0.0.1)上运行的网页运行的PHP代码进行“远程”调试.服务器的PHPinfo()输出在PDT能够调试的笔记本电脑上与上面相同,除了:
xdebug.idekey my_username no value
xdebug.remote_host localhost localhost
xdebug.remote_log no value no value
我很确定这些差异与问题无关.事实上,xdebug.idekey最初是Linux上的“root novalue”,然后我通过编辑PHP.ini并在启动apache的sudo-ed脚本中设置环境变量DBGP_IDEKEY来更改为ECLIPSE_DBGP,徒劳地希望让事情正常工作.
笔记本电脑和Linux机箱之间有防火墙和NAT路由器.所以我试图通过PuTTY ssh隧道使用端口转发来使Linux XDEBUG与Windows PDT通信.我一直在使用XT转发PuTTY几个月没有任何问题.我在PuTTY中设置隧道,本地端口9000转发到Linux机箱上的端口9000,Linux机箱上的端口9000转发到127.0.0.1上的端口9000,PuTTY隧道面板显示:
L9000 host...amazonaws.com:9000
R9000 127.0.0.1:9000
在设置隧道时查看PuTTY事件日志,似乎没有问题:
2010-11-16 18:07:59 Local port 9000 forwarding to host...amazonaws.com:9000
2010-11-16 18:07:59 Requesting remote port 9000 forward to 127.0.0.1:9000
2010-11-16 18:07:59 Remote port forwarding from 9000 enabled
但是当我转到PDT并在指定远程Web服务器的配置上单击Debug时,PDT会在右下角显示背景活动,该活动会停留在57%,如果我单击图标转到进度视图,则显示“启动:等待XDebug会话”.
发生这种情况时,PuTTY事件日志显示:
2010-11-16 19:05:42 Received remote port 9000 open request from 127.0.0.1:54474
2010-11-16 19:05:42 Attempting to forward remote port to 127.0.0.1:9000
2010-11-16 19:05:42 Forwarded port opened successfully
2010-11-16 19:05:42 opening forwarded connection to host...amazonaws.com:9000
2010-11-16 19:05:42 Forwarded connection refused by server: Connect Failed [Connection refused]
2010-11-16 19:05:42 Forwarded port closed
在Linux框中,/ var / log / secure只显示:
Nov 16 19:01:51 ip-10-194-9-67 sshd[14555]: error: connect_to host...amazonaws.com port 9000: Failed.
我已经检查了我的/ etc / ssh / sshd_config,我认为它没关系,甚至将它显式更改为“AllowTcpForwarding yes”,即使这应该是默认值.在我的网络搜索解决方案中,我确实遇到了一个linuxquestions posting,其中最后的回复说了一些相当神秘的sshd需要解析一个主机名:
this seemed to fix it:
The hostname has always been domain-serv,since I always
thought of my router as being domain.com…so after running
hostname domain.com…bam! It finally works…
I guess sometimes it is too simple. sshd had to be resolving domain.com
to my router,ergo the connection Failed.
我觉得这可能与我的问题有关,但这对我来说没有任何意义,因为它已经很老了,而且作者似乎也不理解它,我想我会问这里而不是那里……
我注意到大约一年前在这个论坛上提出了一个只有一个0值响应的similar question,大概是因为这个问题缺乏细节而无法回答.我希望这个人有足够的信息,而且时间不长,所以有人可以指引我.在阅读了常见问题解答以及如何提出问题之后,对于我来说,正确使用论坛是在这个原始的问题不同但内容相同的问题上发布了什么,或者发布这个新问题,我并不完全明白 – 我我相信有人会让我知道什么是正确的选择:-)
我一直对这件事感到疯狂,我怀疑这对有经验的人来说非常明显.虽然不是老式的C编程和用户级Linux和Windows设置,但我对这些东西(PHP,网络编程,网络管理员和这个论坛)都是一个菜鸟.