You should also select Single instance only as it will stop you from launching more than one instance of the same project. You will notice that the IDE key “phpstorm” is already in your 20-xdebug.ini file: xdebug.idekey=”phpstorm” I always put “phpstorm” or something similar. You will be returned to the previous window where you will see that the IDE key is editable, and now you need to enter a key. Select “Use path mapping” and point to the folder of your app.Ĭlick on Apply.I’ve chosen “localbackend1” in this example. Rename your Server to something more soothing.Select the Servers button (…) and then select + (Add new Server). I’ve chosen the name “Tutorial” for obvious reasons ) Then check the “Filter debug connection by IDE key”. There you should select + (Add new configuration) and choose “PHP Remote Debug”.Ĭhange the name of the configuration from “Unnamed” to something else. Save the file and restart the Apache server: sudo service apache2 restart Xdebug and PhpStormįirst you need to open PhpStorm and select Run > Edit Configuration. The default is based on environment settings. xdebug.idekey - Controls which IDE Key Xdebug should pass on to the DBGp debugger handler.xdebug.profiler_enable - Enables Xdebug’s profiler which creates files in the profile output directory.xdebug.var_display_max_depth - Controls how many nested levels of array elements and object properties are when variables are displayed with either xdebug_var_dump(), xdebug.show_local_vars or through Function Traces.xdebug.remote_log - If set to a value, it is used as filename to a file to which all remote debugger communications are logged.
Copy the location somewhere as you will use it later on. Getting startedįirst you need to find the location of the xdebug.so file on your server. In this tutorial I will assume you have Xdebug installed. However, as my project is using PHP5, I’ve had to do it the old fashioned way: looking it up on forums. If you don’t have Xdebug installed on your server but are using PHP7, you can do it by using Tailored Installation Instructions from the official Xdebug site here.
The goal of this tutorial is to get the Xdebug working on your server and then point PhpStorm to Xdebug. It collapses from time to time so I have to redo this setup, and therefore I know this setup works :). The app I am working on runs inside of a Vagrant box which is shaky somehow.
#PHPSTORM TUTORIAL HOW TO#
Since there aren’t many tutorials on how to do it, I’ve encountered some problems on how to get the setup up and running.īy combining a few tutorials and spending a few hours on several forums, I came up with this text. Recently I started focusing more on PHP, and I needed to set up a local debugging environment.