Eclipse PHP / PDT的Xdebug问题

时间:2018-04-22 11:44:48

标签: php eclipse xdebug eclipse-pdt

我在使用PHP Xdebug与Eclipse的后续版本提供的PHP内部服务器时遇到了一些困难。我正在运行Eclipse for PHP Developers Version:Oxygen.3a Release(4.7.3a)。有趣的是,Xdebug在Apache 2上工作得很好,但不是内部的PHP服务器。

请注意,PHP内部服务器正在运行。我可以使用'Run As - 1Run on Server'来运行phpinfo PHP脚本和helloworld PHP脚本。在这些情况下,PHP内部服务器以预期的操作数启动。 Linux ps命令返回:

/usr/bin/php -S 127.0.0.1:8000 -t /home/peter/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/htdocs
  • 请注意,端口8000用于启动内部PHP服务器(我可以正确判断)并且未指定–n操作数。这会导致/etc/php/7.0/cli/php.ini文件被处理(正如我所知道的那样)。
  • 请注意,端口80最初用于运行此服务器。当然,端口80仅限于根应用程序。需要更改端口8000才能启动内部PHP服务器。
  • 另请注意,需要检查“使用系统默认php.ini配置”并清除PHP可执行文件首选项中的PHP ini文件(可选)字段才能删除–n操作数。

另请注意,我在“运行方式”和“调试方式”之间切换时遇到了一些困难。在某些情况下,我收到一条消息,显示所需的端口(8000)已在使用中。但是,到目前为止,我还没有找到重现此问题的方法。

使用上述过程,调试内部PHP服务器在没有–n操作数的情况下启动,并且正在处理php.cli文件。 Linux ps命令返回:

/usr/bin/php -S 127.0.0.1:17278 -t /home/peter/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/htdocs

一个问题是为什么指定了端口17278,而不是预期的端口(8000)。运行phpinfo()表示Xdebug似乎安装在调试内部Web服务器中。一些设置包括:

xdebug support – enabled
IDE Key – peter (my userid on this machine)
DBGp – Common DeBuGger Protocol - $Revision: 1.145 $
xdebug.remote.enable – on
xdebug.remote.port – 9000

我尝试调试helloworld.php。控制台有以下两条消息。第一个显示404代码。第二个显示200代码:

  

[Sun Apr 22 17:36:20 2018] 127.0.0.1:50358 [404]:/?start_debug = 1& debug_fastfile = 1& use_remote = 1& ZRayDisable = 1& send_sess_end = 1   & debug_session_id = 1003& debug_start_session = 1& debug_port = 10137 - 没有这样的文件或目录

     

[Sun Apr 22 17:36:20 2018] 127.0.0.1:50362 [200]:/Server-docroou/helloworld.php?start_debug=1&debug_fastfile=1&use_remote=1&ZRayDisable=1&send_sess_end= 1   &安培; debug_session_id = 1003&安培; debug_start_session = 1&安培; debug_port = 10137

请注意,调试端口指定为10137。也许这就是问题所在。端口10137通常由Zend Debugger使用,我没有使用。

有没有人有任何想法?提前谢谢。

1 个答案:

答案 0 :(得分:0)

在PDT 6.0中修复了问题:https://bugs.eclipse.org/bugs/show_bug.cgi?id=533928;)

相关问题