Another important part of a Web IDE is a debugger. The KDevelop XDebug Plugin is a frontend for the php debugger xdebug, and just had it's first beta release.
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
(download here)
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
You may test the Launch Configuration now by executing it (Run » Execute Launch)
2. Start Debugger
- Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
- Run » Debug Launch
- Happy Debugging :D
The debug session is stopped once the script has ended.
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
You may test the Launch Configuration now by executing it (Run » Execute Launch)
2. Start Debugger
- Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
- Run » Debug Launch
- Happy Debugging :D
The debug session continues the script has ended, you can navigate in the browser to debug further scripts. To end the session execute Run » Stop Jobs.
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.