8

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

3 Answers 3

14

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.

Sign up to request clarification or add additional context in comments.

Comments

0

I'm not sure if this is what you ask for, but you can take a look and decide.

Easy Xdebug with Firefox https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/

Comments

0

Here at Oodles Technologies, we work with PHP on an extensive basis and hope this answer helps.

After opening your the php.ini file, add the following lines:

Note : (php.ini file contains in both the folders that is apache and php, it is advisable to configure the file which is present in apache folder)

<span style="font-size:16px;"><span style="font-family:arial,helvetica,sans-serif;">zend_extension = "c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.0-5.4-vc9.dll"(use zend_extension_ts as variable name if you are using php version below 5.3)
xdebug.remote_enable = 1
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 1
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
</span></span>

After this, Make sure that "c:/wamp/tmp" exist in file system, if not then create that directory.

Then Restart your apache services.

Lastly, open your NetBeans or eclipse IDE and configure xdebug in settings.

I hope you find it useful.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.