Zero-configuration debugging with XDebug and PhpStorm 2.0
This blog post is obsolete!
Please check new up-to-date tutorial on Zero-configuration Web Application Debugging with Xdebug and PhpStorm
We have done a lot of work to simplify the debugging process in PhpStorm 2.0 and we are very grateful to our early adopters for their invaluable feedback. Let’s try a new debugging work flow in PhpStorm 2.0.
Installation of Xdebug
Make sure that you have installed Xdebug properly. Don’t forget to set the xdebug.remote_enable setting to 1. You can validate your installation using checker from xdebug.org
Toggle the ‘PHP Listen debug connections’ button. Don’t use any run configurations.
Set a breakpoint.
Activate debugger on server
In order to activate the debugger you need to set the special GET/POST or COOKIE parameter (more details). You can do it manually, but it is much more convenient to use one of the special tools such as browser toolbars or bookmarklets for that.
Try our bookmarklets generator and get bookmarklets which will work in any modern browser and allow you to start/stop a debugging session by controlling the Xdebug cookie.
Start a debug session in browser.
Reload the current page.
Switch to PhpStorm and set the initial path mappings by selecting the path to the local copy of the script that we are debugging. These paths are similar if you are editing files directly on the server.
On reaching the breakpoint the debugger suspends. Now let’s investigate the application!
In some cases you may get an error message “Remote file path ‘path/to/script/on/server.php’ is not mapped to any file path in project“. This means that PhpStorm does not know which local file corresponds to the specified remote file path.
You can solve this problem quickly. Just click the ‘Edit path mappings’ link and set the necessary path mappings.
Working with Windows Azure SQL Database in PhpStorm
PhpStorm provides us the possibility to connect to Windows Azure SQL Database right from within the IDE. In this post, we’ll explore several options that are available for working with Windows Azure SQL Database (or database systems like SQL Server, MySQL, PostgreSQL or Oracle, for that matter): …
Change signature refactoring in PhpStorm
A very powerful refactoring is the Change signature refactoring in PhpStorm. It enables us to modify a function signature in many ways: we can change the function name, change its visibility, add, remove and reorder parameters as well as rename parameters. (more…)…
Folding for imports in PhpStorm 6.0
In PhpStorm 6, we've introduced code folding for imports. Any list of imports will now be folded into a single line. This greatly reduced clutter in your editor when having a lot of imports! (more…)…
Drag & Drop Project Files to Remote Hosts in PhpStorm
The Remote Host pane allows us to work directly on a remote server through FTP, FTPS, SFTP or a local/network folder. A lot of people asked us to add drag & drop to the Remote Host pane in PhpStorm. Good news: PhpStorm 6 comes with drag & drop as well as copy & paste support from the pro…