Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse opening files with full path when debugging PHP

I have a local PHP server that has xdebug installed alongside eclipse with Xdebug JIT setup. Everything is working great except one significantly annoying problem.

The problem is that every time I hit a breakpoint in my PHP script, Eclipse opens the php file with the full path rather than the workspace-relative one. This creates two files that are open, which isn't a problem except setting breakpoints within the absolute file don't properly display in the code tab (they show up in the breakpoint list though), and setting or removing breakpoints between the different files are path specific - so you can't interact with breakpoints from the other file representation. Also, jumping to a new file opens in the same tab. I would like eclipse to use the tabs I already have open, which i think would happen if it was not using absolute paths to open the files.

I've tried setting up path maps in the PHP server configuration, but they didn't seem to have any effect. I'm open to any suggestions to try.

Thanks!

like image 882
cyberconte Avatar asked Apr 05 '12 22:04

cyberconte


People also ask

Why is Xdebug not working?

Xdebug cannot connect to PhpStorm This means that Xdebug tries to connect to the host and can't make the connection. To fix the issue, set xdebug. remote_connect_back=0 ( xdebug. discover_client_host=false for Xdebug 3) and make sure that xdebug.


1 Answers

You need to set up path mappings to map files of your project to the server running php with x-debug

http://www.eclipse.org/pdt/help/html/path_mapping.htm

like image 57
xatzistnr Avatar answered Sep 21 '22 14:09

xatzistnr