Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging PHP files on browser with Eclipse and xDebug

Tags:

eclipse

xdebug

I have been reading online about debugging with PHP for Developers on Eclipse and xDebug. I have installed all the necessary files for xDebug, and now when I am in Eclipse I can run the debugger with a script and it works just fine.

The issue is that i am using AppServ (Apache, PHP and MySQL) on my Windows machine, and what I would like to do is to debug my PHP files in Eclipse when I am loading the PHP pages in my browser (instead of running them as scripts in Eclipse).

Is that possible?

Joel

like image 922
Joel Avatar asked Apr 04 '11 15:04

Joel


People also ask

How do I debug PHP in Chrome?

Q: How to debug PHP in Chrome? A: You can easily debug PHP in Chrome using a simple extension called PHP Console. Just install this PHP debugging tool from the Chrome web store and start logging errors, warnings, exceptions, and vars dump on your Chrome browser.

Where do I put xdebug in PHP INI?

For Windows, this is normally "c:\xampp\apache\bin\php. ini". Important note for Windows 7 & Vista users: As of August 2013 (XAMPP version 1.8. 2), the file "php_xdebug.


1 Answers

In Eclipse, go to 'Preferences' then 'PHP' 'Debug' 'Installed Debuggers', 'XDebug', then 'Configure'

In Eclipse, go to 'Preferences' then 'PHP' 'Debug' 'Installed Debuggers', 'XDebug', then 'Configure'

For 'Accept remote session' change this to 'localhost'

This will tell XDebug in Eclipse to debug whenever anyone connects with xdebug cookies or URL params set - using this with Easy Xdebug or xDebug Helper then makes debugging from realistic in-browser contexts a doddle.

I'm assuming you have Eclipse PDT for this, I'm not sure if the steps are different otherwise.

like image 193
Kevin Sedgley Avatar answered Nov 19 '22 07:11

Kevin Sedgley