Question

Yes I have tried searching on StackOverflow and Google for my problem. If you read the entire question you will see that I include a lot of links to previous answers that I found using both.

I have been trying to get XDebug working with Version: Juno Service Release 2 of Eclipse for about the past hour and a half and I'm running into a log of issues. I've already solved most of my problems by using stack overflow and Google.

I followed the steps here first to install the debugger.

I made sure that I added the debugger as a zend_extension as mentioned in this post.

Here are the relevant lines from my php.ini file

zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.collect_params=4
xdebug.var_display_max_depth=999
xdebug.dump.POST=*
xdebug.dump.GET=*
xdebug.show_local_vars=1

I made sure that I edited the php.ini file for the 5.3 version of php that comes with MAMP. At this point the debugger would start even though XDebug does show up when I run php -v.

Since I was still having issues I checked the logs just like someone did here. I noticed this error in the logs:

PHP Fatal error:  Class 'Model' not found in ...

After checking the documentation for the latest version of CodeIgniter I noticed that all Models have to extend CI_Model and not Model.

I fixed that and the error is no longer being printed to the logs, but now things just don't work. The debugger won't go past the first line when I try to debug a file.

I'm trying to debug my php application as a PHP CLI Application. When I try to debug the application as a PHP Web Application I get an error message that says:

No tab group defined for launch configuration type org.eclipse.php.debug.core.launching.webPageLaunch

After Googling the problem, I came across this post that suggested that you might not be able to do what I'm trying to do. Since the question was first asked in 2009, I decided to try the second suggestion and check for any updates.

After updating all of my Eclipse plugins I was still having the same problem. After searching on SO some more, I saw that this guy just gave up and tried with NetBeans and got everything to work.

Should I just consider the past 1.5 - 2 hours as a sunk cost and just move on to a different IDE?

Was it helpful?

Solution

I also had issues getting XDebug to work with Eclipse and XAMPP. In the end I decided to go with Netbeans and it was a lot smoother getting it setup. I am still using Netbeans to date for all of my PHP development.

OTHER TIPS

Possibility your Php CLI is picking wrong php.ini file ?

Please go to terminal and check which ini file is loaded by :

php --ini

and make sure its desired one.

jerrod.taylor,

I had a lot of issues when starting use PHP,Xdebug and Eclipse. I considered change IDE myself but I liked the challenge and found a lot of help online. I will try to provide you with some tips will help you.

First of all this is the parameters I have in my php.ini:

zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9060
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=On

I am using local machine as remote host. Adapt for your world. This configuration works for me with CLI and Web debugging. I am really not sure if some of them is specific for different kinds of debug. So, lets start with all of them.

Now, make sure xdebug is been supported. Run the following command and see if exist something not good.

php -i|grep xdebug

NOw, lets go to Eclipse. In Eclipse preferences add the correspondent PHP executable and make sure the debuger type is Xdebug. This step can be done navigating through Preferences->PHP->PHP Executables. If you add an item, the form you ask you for the following information:

Name : Choose one
Executable Path : the_path_to_php_exe
PHP Ini file : you can leave it blank
SAPI type : CLI
PHP debugger : Xdebug

This step is important. It is how we will tell eclipse the executable to use.

Now, lets add a debug configuration. I have one project called upload in my workspace and exist a file index.php on this project. To create a debug configuration click in new when "PHP CLI Application" is selected. It will be add a new configuration form for you. For my Debug configuration I have the following information:

Tab PHP Script


Run Time PHP
   Alternat PHP: (Select the PHP executable you have created above)
PHP File : /upload/index.php
Break Point : Break at first line is selected

This steps should be enough to you solve your issues. Let us know how it was.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top