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?
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.
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.
Related
I'm trying to run a CLI script in PhpStorm and use the debugger to step through it.
It took some doing, but I now have Xdebug installed and the PhpStorm CLI Interpreters dialog confirms that:
I created a Run/Debug config and when I try to execute/debug it, the script runs all the way through without breaking at my breakpoints and I get this error at the bottom of PhpStorm:
The PhpStorm docs say that xdebug for CLI scripts can configured with an environment variable like this:
export XDEBUG_CONFIG="remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0"
I've confirmed that PhpStorm sees that environment variable:
Here is my Run/Debug config:
I'm at a complete loss here. How the heck can I get this thing to debug a CLI php script? Any help is appreciated.
Gah, I hate it when I spend a couple of hours trying to fix something and discover it's totally unrelated.
The problem was that I'm using short tags and my cli php.ini file had short_open_tag=Off. The code I'm running is normally run in a web context and the php.ini for that web context had short_open_tag=On so the code was working.
This code is an api endpoint and I needed to be able to step through and see what was going on and there's nothing that inherently requires it to run in the web context (except for the input params, but I'm faking those for testing purposes anyway).
So, my debug configuration was fine.
I discovered it by trying to reduce the problem further and further and I just tried running the code directly from a command line (php sync.php) to see that it was at least working and producing the correct output.
It wasn't producing the normal api json output, it was just echoing all of the code in the file. That's what led me down the path to realizing my stupid mistake.
I am using Eclipse for PHP Luna Service Release 1 (4.4.1), and try to install xdebug for debugging. I follow this blog for for setting xdebug on xampp 1.8.1. Follow is my php.ini settings.
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
Basically it will stop on the break point i set, but then i press [F6], it will not go to next line.
But in debug dialog window, line number keep going, and variables also change too.
Does anyone knows what wrong on this? thanks.
I think I found a bug report on this issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=445903
It's marked as solved, so maybe on the next release this issue should be gone.
EDIT: updating PDT to version 3.3.2 http://download.eclipse.org/tools/pdt/updates/3.3.2/ solves this issue (at least in my install)
Yes, this seems to be a bug, I hit it after updating.
It does step to the next line though, it just doesn't update the highlight and current position.
Over the last few years I've experienced quite a few of such annoying bugs in Eclipse IDE for PHP Developers (PDT) with official updates. One might get the impression that the developers don't pay much attention to regression testing.
Solution:
If you've updated Eclipse recently, open "Help" -> "Installation Details". Click on the tab "Installation History" and find an entry that doesn't contain version 4.4.1 (it's 4.4.0.20140612-0500 here).
The Eclipse project page is a bit messy in my opinion (or I'm just blind), but you can fortunately crawl a mirror site to find older releases:
http://ftp.yz.yamagata-u.ac.jp/pub/eclipse/technology/epp/downloads/release/luna/R/
I also had the same problem, where the stepping through the code would not go to the next line. I realized that the problem was that the remote php script which I was debugging, had a line of code which was not present in the local php script in Eclipse. Updating the local php script to match the remote php script fixed the problem.
I got a real problem with Komodo Edit v8.5.3: I use XAMPP XAMPP v1.8.3 [PHP: 5.5.6] to provide a local hosted server for Komodo.
[Edit -> Preferences -> Languages -> PHP] ; here I configured the PHP stuff like this:
**Default PHP Interpreter** C:\xampp\php\php.exe
**Path to alternate PHP configuration file** C:\xampp\php\php.ini
**PHP Directories** nothing
After restarting I tested this feature: But no autocomplet and calltips, syntax checking did sometimes work ...
If I wrote some code, it began to scan the php directory of XAMPP for completing, but this search got freezed everytime somewhere (in the PEAR directory).
I don't really understand what's wrong with Komodo and XAMPP. (I did also reinstall Komodo.)
Komodo is great, but withoutd this the most importent feature is impossible.
Komodo php autocomplete didn't work for me, too.
My situation might be different, but I'm sharing for the next Googler to visit.
I installed Komodo before php5. Whoops. Installing php wasn't good enough, I had to also delete the config files in ~/.komodo-edit (or whatever folder it created).
That still wasn't enough, I also had to delete the ___.komodoproject file I was working on as well.
Then I was awed by Komodo's awesomeness.
Komodo Edit 8.5.3 has a memory leak problem. To confirm this check your process list and you will see Komodo Edit main thread and Python child thread. Watch to see the memory footprint of the Python thread as the scan progresses.
If the memory is large (for me is was over 1GB), try upgrading to a later release.
At time of writing this, you can find version 8.5.4 here:
http://downloads.activestate.com/Komodo/nightly/komodoide/latest/
I apologize if I am not following protocol with this question; I realize it has been asked. However, I have yet to see an answer (that works)
I am trying to get xdebug working on a Windows 7 box.
Whatever build I try (and I have tried more 5 to this point), I get this message when I run php -m : Failed loading C:\PHP5\ext\php_xdebug-2.2.2-[compile + build].dll
I have used the "wizard" (it doesn't provide much information) and it is the only module that doesn't work.
Make XDebug works can be a little trick. But, after move through all challenges, you will see the benefits of quickly find bugs and quickly fix them.
First of all, you need to find out which is the version for your environment. It is tight related with PHP version you are running and XDebug page is the place to go to figure it out.
The XDebug wizard helps you to get the Xdebug module compiled to fit your environment.
If you copy the output of the following command:
php -i
inside the text box and hit the button "Analyse my phpinfo() output" as showed below:
You will see a report about the XDebug version you need. Most of times, the link to download it is available as showed below. If the link do not show, your version should have no compatibility with Xdebug
After follow the instruction gave by wizard page, the output of the command:
php -m
should be something like the image below:
Xdebug load successfully on [Zend Modules] group. Of course, it is not enough to make it work. But will be enough to you move forward. You told us, you used the wizard. If the steps above was the same you follow tell us what is the wizard output as a comment.
My Xdebug works fine when I use eclipses' internal browser but when I use it in an external browser apache crashes.
I am using xampp and on windows 7 64 bit. If someone needs more information let me know.
For some reason if I have the variables tab open in the php debugger in eclipse it crashes apache. So to stop it I just can't have variables tab open while debugging. So this avoids the problem but doesn't fix it. I would like to be able to have this tab. Any suggestions?
It is possible that the XDebug build and type does not match your apache & php build and type...
Apache compiled with VS.NET 2008 (VC9) for 32bit and using PHP as a module would require XDebug: 32bit, VC9, Thread Safe.
http://xdebug.org/download.php
Also, you could test another WAMP package that comes with XDebug (for example WampDeveloper) and if it also does not work for you, it's probably not a build mismatch issue.
Hey I got this working
Eclipse 3.6.1 (because on later versions key shortcut for putting line comment don't work)
Xampp 1.7.4
Xdebug 2.1.2
The trick is to change php from VC6 to VC9 and then it just works correctly.
BTW. It's the variables panel that causes xdebug to crash apache on php VC6.
Remember to get VC9 version of xdebug for new php AND if you put your new php in directory other than
\xampp\php, then on phpinfo(); you'll see that there's no php.ini loaded so just rename old php (co you can swich them from one to other anytime) and put new php in the same directory in which original php was in "\xampp\php" and copy your php.ini (because paths doesn't change). Also remember to obtain any additional php extensions you've been using in VC9 version for new php and put them in "\xampp\php\ext"
I can confirm most of what t0meck said. Except I've moved up to xampp-win32-1.7.7-VC9 which has PHP 5.38. Taking the phpinfo() results from that to Xdebug's custom installation analyzer, it specifies the php_xdebug-2.1.2-5.3-vc9.dll, but the problem isn't entirely eliminated. As I've documented in my 'notes to self' page, the following is working for me.
After following the above procedure, the 'run as' should work on the first try, but the 'debug as' may crash Apache at every attempt. This is an issue that has driven many people to severe distraction. There is an apparent bug exposed using the debug perspective. At the top center of the perspective is a window with two tabs, the variable view and the breakpoint view. Usually, Apache crashes only when the variable view is highlighted, so highlight the breakpoint view instead. Then set a breakpoint on your project. Now, if you are one of the chosen, you will be able to step through the script using the debugger, but when you switch to the variable view it may still crash Apache. What a drag. Repeat the process and the next time you should actually see the variables and the problem will magically go away, until you restart the project. Just repeat the procedure and be satisfied with being one of the lucky ones.
Don't know if this help, I have same kind of issue, but it relate to array depth xdebug >handle in Variables view. And you can change it. Widnow > Preferences > PHP > Debug > >Installed Debug > Xdebug > Configure enlarge the "Max array depth" solved my issue.
http://bugs.xdebug.org/view.php?id=658#c1767
Just set it to 10 or bigger and it should work