I'll explain in this post how to set it up.
Prerequisites:
- Php
- XDebug extension
- xdebug configured to accept remote connections
- xdebug.remote_enable = 1
- xdebug.remote_host = localhost (yourhost if on remote server)
- KDevplatform, KDevelop
- The following KDevelop Plugins:
- executescript
- executebrowser
- xdebug
Debugging a CLI Script
1. Create Launch Configuration
- Run » Configure Launches...
- add Launch Configuration (+)
- choose Type "Script Application"
- enter interpreter "php"
- enter script path
- activate the new Launch Configuration in Run » Current Launch Config
2. Start Debugger
- Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
- Run » Debug Launch
- Happy Debugging :D
Debugging a Website
1. Create Launch Configuration
- Run » Configure Launches...
- add Launch Configuration (+)
- choose Type "Browser Application"
- enter server host and path
- activate the new Launch Configuration in Run » Current Launch Config
2. Start Debugger
- Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
- Run » Debug Launch
- Happy Debugging :D
Remote debugging is possible too, but that is not described in this tutorial.
If you have problems with configuration, or find any other problem send a mail to kdevelop-devel _at_ kdevelop.org.




Then it's really simple to get XDebug working to debug your scripts..
ReplyDeleteAwesome, I can't wait until end of compile :) I'm really sick from the terrislow java ides.
ReplyDeleteThis not work. In Kdevelop menu "Run" is not present.
ReplyDeleteI did not get it to work before, but now, together with KDE SC 4.4, I installed the latest beta of Kdevelop plus plugins as provided by OpenSuse, and now it works!!!
ReplyDeleteCode completion works now, it is one of the most useful features, indeed.
So that’s halfway there, and I hope that Quanta 4 comes rather sooner than later.
i thought this was a really great post to read. i'll check back for new posts by you!
ReplyDeleteHi.
ReplyDeleteI use kdevelop-php 1.1.0 and "all" works fine, just I cannot seem to find, configure xdebug. When I add Launch Configuration I can only choose Native Application and in debug I can only choose GDB. I can create new PHP project and use all nice features that comes with it (autocomplete), it just seems that xdebug support was not compiled with or am I wrong?
I use Gentoo.
Thank you and kind regards.
Rok, how did you install xdebug?
ReplyDeletedid you run kbuildsycoca4?
Please ask any questions on the kdevelop-devel mailing list.
Yes I did run kbuildsycoca4.
ReplyDeleteOK, I created new topic on kdevelop forum:
Follow:
http://www.kdevelop.org/phorum5/read.php?7,33277
sorry, I meant the mailing list, please subscribe here: http://www.kdevelop.org/index.html?filename=mailinglist.html (kdevelop-devel)
ReplyDeleteBut I think I know the reason why it doesn't work: change X-KDevelop-Version to 11 in kdevxdebug.desktop, then it should load the plugin
I do not seem to find this file except in quanta sources. Is quanta maybe successor of kdevelop?
ReplyDelete@Rok: the xdebug plugin moved to quanta. Quanta a kdevplatform based application optimized for web development. KDevelop is a kdevplatform based application optimized for cpp development.
ReplyDeleteThe only difference is the default set of plugins and well - the splash screen. And KDevelop is a stable application while Quanta is not.
So you can use xdebug in kdevelop.
mmm. How would I go about remote debugging?
ReplyDeleteCan anyone suggest?
Is this still working? Was trying with the latest kdevelop and quanta-git , changed version to 11 in the .desktop files and cant see the plugins anywhere.
ReplyDeleteAny ideas?
@rg: it should still work. did you run kbuildsycoca4 after installing?
ReplyDeleteplease ask on the kdevelop-devel mailinglist for help.
where can I get an ubuntu build? would it be helpful to make a ppa for the plugin?
ReplyDeletehow to compile
ReplyDeleteexecutescript
executebrowser
xdebug
these files after downloading im using kubuntu 11.04 please help. give me the commands. I do have php code completion.
@Anonymous:
ReplyDeletethe code is getting moved around atm.
executescript is now in kdevplatform.
executebrowser and xdebug are in quanta, and will soon get their own repository.
(all to be found on projects.kde.org)
Hi Niko, that would be really a great info u have shared about the debugger, in fact debugger plays the best part in PHP programming that too with the XDebug plugin.
ReplyDeleteCheers !
Hello Niko,
ReplyDeletethanks for all your work, it would be great to use xdebug with kdevelop for me.
Unfortunately i cannot compile the xdebug from latest Quanta repository because cmake cannot find the executescript plugin in debuggers/xdebug/CMakeLists.txt
Code:
find_path( EXECUTESCRIPT_INCLUDE_DIR iexecutescriptplugin.h
PATH_SUFFIXES kdevexecutescript )
I tried some solutions found around the web (eg: changing path to kdevplatform/executescript) unsuccessfully, do you have any idea?
I am running into the same build issue :-( I am on Kubuntu, but I will try to build on openSUSE.
ReplyDeleteThis blog entry was from almost two years ago, and this is a big issue keeping KDevelop to be used as a series PHP development tool. Is there a bug report on this?
Hi,
ReplyDeleteuse this repository:
git://anongit.kde.org/scratch/nsams/kdev-xdebug.git
The plan is to make xdebug plugin a standalone project and repository, for now use that one.
really great
ReplyDelete> Remote debugging is possible too, but that is not described in this tutorial.
ReplyDeleteThen WWWW HHHH EEEE RRRR EEEE is it described?
Since there is no step by step on the Internet to get this going here it is:
ReplyDeletegit clone git://anongit.kde.org/scratch/nsams/kdev-executebrowser.git
cd kdev-executebrowser
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ../
make
sudo make install
kdev-xdebug has been moved around but its CMakeLists.txt has not been updated to reflect this and will fail with an error about EXECUTESCRIPT_INCLUDE_DIR. Apply the simple one line patch in bug report before attempting the cmake: https://bugs.kde.org/show_bug.cgi?id=284430. With that in mind:
git clone git://anongit.kde.org/scratch/nsams/kdev-xdebug.git
cd kdev-executebrowser
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ../
make
sudo make install
Might have noticed a pattern there ;)
Hope that helps folks save some time.
Adam
Woops. The line "cd kdev-executebrowser" in the compile steps for kdev-xdebug should obviously be: cd kdev-xdebug. That'll teach me to lazily cut and paste.
ReplyDeleteFirst, thanks for this plugin! I don't like using Eclipse/Netbeans for development, so being able to use xdebug+php inside of kdevelop is a serious win.
ReplyDeleteI just got this working in Fedora 17. I tried the latest in git, but there's some commits in kdev-xdebug that don't fly with the older stable kdevelop-libs in F17. (latest git for kdev-executebrowser builds fine though) The beta released in October (1.3.80) seems to compile and load correctly. Kdevelop doesn't crash, there's no rpath warnings during the builds, etc.
Hope these SRPM's save someone else some time:
http://www.deepgroove.org/rpm/SRPMS/kdev-executebrowser-1.3.80-2.fc17.src.rpm
http://www.deepgroove.org/rpm/SRPMS/kdev-xdebug-1.3.80-1.fc17.src.rpm
compile with: rpmbuild --rebuild
Built and tested in F17 x86_64. ymmv, hth, etc.