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.
Related
It's an old-age question. Am crawling at this point. It's year 2023, and yes, I have read tons of post here and elsewhere on the internet pertaining to this issue. It's important I use Xdebug for development. It's really concerning since a job that was to take half a day is now in its fifth day.
I have these settings;
;[xdebug]
;zend_extension=xdebug
xdebug.mode=debug
xdebug.log_level=0
xdebug.client_host=127.0.0.1
xdebug.remote_connect_back=0
Using Xdebug with PhpStorm.
When Xdebug is enabled (uncommented above), pages clock at 6s-25s or more. When disabled, pages come in like a cool breeze at 800ms. Am unable to figure out what is wrong!
Why so slow? What can I do to improve speed? Thank you.
I had the same problem on an Windows 10 machine with VS-Code (Visual Studio Code) IDE and XAMPP for local Wordpress development: PHP takes 10 to 20 times longer for execution when xdebug is activated.
There is a workaround for this problem.
In php.ini configure:
xdebug.start_with_request = trigger
and in your PHP-Code use:
xdebug_break();
As a consequence of this, xdebug will start working only if it receives the signal "xdebug_break();" in your PHP code. There will be a breakpoint in the line after that. Then you can continue with step debugging etc.
As I said: I don't use PhpStorm, but Visual Studio Code as an IDE. In VS Code you need to install the PHP extension pack and then start the VS Code debugger with "Listen for xdebug".
Hopefully this will work with PhpStorm, too.
Hopefully the following will give you enough to go on.
My setup
I'm using:
Windows 10 (now at build 19043.1288),
VSCode (v1.61.2) with
PHP debug (v1.21.1),
both Firefox and Google Chrome browsers,
XAMPP (v3.3.0)
Xdebug (now v3.1.1-7.4x86_64)
I'm also running Ubiquiti network controller, and BitDefender AV in the background.
PHP.ini
[Xdebug]
zend_extension = xdebug
;zend_extension = "c:\xampp\php\ext\php_xdebug-3.1.1-7.4-vc15-x86_64.dll"
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
xdebug.log = "c:\xampp\htdocs\j4\tmp\xdebug.log"
Problem
I've had VSCode/XAMPP/Xdebug working with Joomla 3 for well over a year without issues. I went away for a couple of weeks and when I came back I wasn't able to single step into any of the Joomla 3 modules/classes. VSCode would stop at breakpoint, but both single step and step into immediately went to the parent calling function.
Ah, I said to myself, probably Windows did something - may be a good time to upgrade to J4, as well as update my environment. Same problem. Stops at 1st breakpoint, won't single step or step into - it won't stop at subsequent breakpoints. Appears to single step in the core J4 modules. Stack appears normal - initialised variables can be inspected.
What I've tried
Everything! To keep this relevant - I've now installed a completely fresh, out of the box, unadulterated, XAMPP, Joomla4 and Xdebug (as recommended by Xdebug wizard). I've also temporarily disabled my AV (BitDefender). I don't have any firewalls on my PC, as I'm behind a network firewall.
Just in case, I did a deep virus scan and disk check - nothing.
Prior to installing everything fresh, I was able to get an Xdebug log file, but now I can't. I also noted that the breakpoints wouldn't reset - I'd remove all the BPs and they'd come back on next run. I'd have to stop and restart the PHP debug in VSCode to make them go away.
I suspect that the latest Windows updates (or maybe the last few), did something to my dev environment.
However, it's also possible that I've missed something stupid in the setup, as I've been round the circuit several times already, and my head isn't functioning as it should.
Where I need help
I'm now at a loss at what to try next - any suggestions? If no-one else can reproduce this - it means something in my system has glitched, any help would be appreciated.
Update 1
I discovered that a v2 of Xdebug had crept into my php/ext directory - not too sure how - and that was why I wasn't able to get a log file to work. I now have the correct version (3.1.1) of Xdebug installed and working. The single step issue, however, remains.
I now have a log from VSC debug console as well as from xdebug.log: see here
One thing I observe is that there are many errors associated with deprecated functions - I would have expected them to be warnings and not errors!
There are also numerous cases of "error evaluating code".
I have highlighted the place where the code stopped in the logs with "************". I don't know if this is expected or normal, but it does seem to occur a short time before the breakpoint stop - line 431 vs line 651 in the debug console log.
Update 2
Just in case anyone has any interest - I installed the latest version of Eclipse IDE with PDT. Used exactly the same XAMPP/htdocs directory as before - and Xdebug works as expected. No issues with single stepping.
This means, I believe, that Windows, XAMPP, Xdebug and Joomla can be ruled out as culprits, as these are common to both environments. Conversely, it also means that there's something going on with VSCode, or at least with my particular VSCode setup.
Breakthrough (I think!)
It appears that a couple of variables (e.g. $this->missingclasses) I had put into the watch window were causing the problem. I suspect that over the course of a few VSCode updates the persistent internal objects associated with those variables had glitched/corrupted. When I deleted the offending variable watches - single step started to work again.
After seeing that that worked, I was able to put the watches back and single stepping worked as expected. Putting the same watched variables into Eclipse had no effect on single stepping.
Just for good measure, I also deleted and reinstalled PHP Debug - although I'm pretty sure the watched variables, that couldn't be evaluated, were the real issue here.
I will leave this a couple of days, and then I'll close this with a suggested solution
I have installed Xampp on Windows (Well actually both xampp and wamp but both have the same problem), and enabled xdebug. I have installed the latest eclipse for php with pdt included. The breakpoints are working correctly however if I press f6 or f5 the current line does not get updated, the variables change as if I had stepped to the following line but the highlighted line remains the same. Any ideas?
I attach some screenshots to make it easier to understand:
Breakpoint works:
I press f6, lineno and $a changes in the 'Debug' and 'Variables' window:
I press f6 again:
I tried updating to the latest xdebug but the same thing happens.
This is problem in Eclipse SR1. You should switch back to R (SR0) release, next you can install PDT 3.3.1 from marketplace.
See also bug report on bugzilla
Edit:
Problem is fixed in nightly builds: http://download.eclipse.org/tools/pdt/updates/3.4-nightly/
Edit 2:
We released new stable (3.3.2) version with fix for this problem. You can find it on marketplace or in this update site: http://download.eclipse.org/tools/pdt/updates/3.3.2/
Goto Eclipse->Help->Install New Software
Work with: http://download.eclipse.org/tools/pdt/updates/3.3.2/ (this worked for me)
Alternative: You might want to use the latest stable update site: http://download.eclipse.org/tools/pdt/updates/latest/
[If not already existing]: click (Add) & give a name like "PDT" in order to add the upgrade site.
Type "PDT" and tick checkbox for "PHP Development Tools (PDT)"
Accept the license stuff and upgrade PDT.
Restart Eclipse
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/
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.