|XDebug Problems with Eclipse PHP/PDT [message #1785887]
||Sun, 22 April 2018 11:53
| Peter Schaeffer
Registered: September 2017
I am having some difficulty using PHP xdebug with the PHP internal server provided by later releases of Eclipse. I am running Eclipse for PHP Developers Version: Oxygen.3a Release (4.7.3a). Interestingly enough xdebug is working quite well with Apache 2, but not the internal PHP server. |
Note that the PHP internal server is running. I can use 'Run As 1Run on Server' to run a phpinfo PHP script and a helloworld PHP script. In these cases, the PHP internal server is started with the expected operands. The Linux ps command returns.
/usr/bin/php -S 127.0.0.1:8000 -t /home/peter/eclipse-
Note that port 8000 is used to start the internal PHP server (correctly as best I can tell) and no n operand is specified. This causes the /etc/php/7.0/cli/php.ini file to be processed (correctly as best I can tell). Note that port 80 was originally used to run this server. Of course, port 80 is retricted to root applications. The change to port 8000 was required to get the internal PHP server to start at all. Also note that checking 'Use system default php.ini configuration' and clearing the PHP ini file (optional) field in the PHP Executable preferences was required to get rid of the n operand.
Also note that I am having some difficulty switching between 'Run As' and 'Debug As'. In some cases I get a message showing that the required port (8000) is already in use. However, I have not found a way to reproduce this problem so far.
Using the procedures described above, the debug internal PHP server was started without the n operand and is processing the php.cli file. The Linux ps command returns.
/usr/bin/php -S 127.0.0.1:17278 -t /home/peter/eclipse-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/htdocs
One question is why port 17278 was specified, rather then the expected port (8000). Running phpinfo() shows that xdebug appears to be installed in the debug internal web server. A few settings include
xdebug support enabled
IDE Key peter (my userid on this machine)
DBGp Common DeBuGger Protocol - $Revision: 1.145 $
I tried to debug helloworld.php. The console has the following two messages. The first message shows a 404 code. The second message shows a 200 code.
[Sun Apr 22 17:36:20 2018] 127.0.0.1:50358 : /?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 - No such file or directory
[Sun Apr 22 17:36:20 2018] 127.0.0.1:50362 : /Server-docroou/helloworld.php?start_debug=1&debug_fastfile=1&use_remote=1&ZRayDisable=1&send_sess_end=1
Note that the debug port is specified as 10137. Perhaps this is causing the problem. Port 10137 is normally used by the Zend debugger which I am not using. It turns out that the other operands (ZRayDisable, debug_session_id, etc.) are also associated with Zend. However, I am not using the Zend debugger.
Does anyone have any ideas? Thank you in advance. Note that this question has also been posted to SO.
[Updated on: Tue, 24 April 2018 21:34]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01759 seconds