PHP remote debugging using XDebug

I have many questions about how to debug php files using xdebug and eclipse on a remote server.

I would like to achieve : I have a remote server (with WAMPP (appache (Port 8502), php, mysql (port 8501), etc.)), and I would like to debug php files from Eclipse PDT from my local PC.

I prepared the following things :

  • Installed Eclipse PDT (build code:
    20100617-1415) on my local PC.
  • Installed and activated xdebug on a remote server (available at (lets say) 111.111.111.111:8502) with the following configuration within php.ini

[XDebug] zend_extension = C:\TYPO3_4.4.6\php\ext\php_xdebug-2.1.0-5.3-vc6.dll xdebug.profiler_output_dir = "C:/xampp/tmp/xdebug" xdebug.profiler_output_name = "cachegrind.out.%p" xdebug.profiler_enable = 0 xdebug.profiler_append=0 xdebug.extended_info=1 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=127.0.0.1 xdebug.remote_port=9000 xdebug.idekey=ECLIPSE_DBGP xdebug.remote_log="C:\TYPO3_4.4.6\tmp\xdebug\xdebug_remote.log" xdebug.show_exception_trace=0 xdebug.show_local_vars=9 xdebug.show_mem_delta=0 xdebug.trace_format=0 

  • In Eclipse, I added the server to "Window - PHP - PHP Servers" with the URL "http://111.111.111.111:8502" and Path - the path to the server: "C: \ TYPO3_4.4.6 \ htdocs" and "Path to the Workspace : "/ debug_test" (I created a PHP Project named "debug_test").

  • I also changed PHP-Debug to the following:

    • PHP debugger: XDebug
    • Server: 111.111.111.111
    • PHP executable Undefined
  • Next, I added the debug configuration (PHP web page):

    • Server Debugger: XDebug
    • PHP server: 111.111.111.111
    • File: /debug_test/debug.php
    • Break on the first line: off
    • Auto Generate: on
  • I created the debug.php file on a remote server in C: \ TYPO3_4.4.6 \ htdocs \ debug_test \ and in my PHP project ("debug_test").

If I now start Debugging and select my configuration file, the web page appears (in an external browser) with the URL http://111.111.111.111:8502/debug_test/debug.php?XDEBUG_SESSION_STOP_NO_EXEC=ECLIPSE_DBGP&KEY=12965739868 ) loaded like a normal page, but it's impossible to debug it. Even if I switch to PHP Debug - View and insert any breakpoints or something like this, there is nothing like debugging.

How can I get to the point that I can perform remote debugging with xdebug and eclipse pdt?

Cheers, Cheeesi

+4
source share
1 answer

Are you sure that your XDebug client / PC can be reached at 127.0.0.1 from your server?

B / c, if I understood correctly that your server is not installed on your PC. OTOH, then I am wondering how you install the ypur XAMPP system. B / c, then usually all your materials are locally installed.

Browser behavior is also important. If your site is fully loaded after calling the XDebug session via Eclipse, your XDebug-Client in Eclipse will not be able to contact your server. If you see that your browser is trying to load the page, but it is stopping, your client may inform the server about the start of the XDebug session, but your XDebug on the server could not connect back.

The port 8502 that you specified for your server is also an odd bit, but may be correct, given the appropriate configurations.

Best wishes

Raffael

EDIT: and for the first try, you should include a break in the first line

0
source

Source: https://habr.com/ru/post/1337982/


All Articles