
Don't forget to edit xdebug.ini in your PHP's configuration to have "xdebug.remote_enable=1"įirst, we're gonna need to tell the IDE about the web server it needs to talk to:įile -> Settings -> Project settings -> PHP -> Servers.Ĭlick (+) -> Name: give a name (example: mysite localhost) Host: hostname used to access the web app from the browser (example: mysite.local is a commonly used convention) port: probably leave on 80 Debugger: xdebug Please refer to xDebug documentation for information about this.
#PHPSTORM IDE INSTALL#
Make sure to install it in your PHP environment where you'll do the debugging (localhost). This assumes that you'll use the popular xDebug PHP extension for the server side debugger component (the client side is PHP Storm itself). The Internet have lots of useful tutorials these days for PHP debugging (for example (a bit old but still useful): ). This article is not intended to be a complete debugging PHP web app tutorial but just to hint the reader in the places to edit with basic values to use as configuring the IDE and the environment for debugging might require more work and configuration.
#PHPSTORM IDE CODE#
The following instructions are suitable for a simple use case where a developer run his web app on the same machine (with URL like mysite.local) and where the IDE edits the code in the doc root directly.

Many developers have a working web server on the same machine in which they develop. Its a big topic which probably deserves a separate wiki. I've sketched below a draft for its content. I think its good to have a section of "debugging" in this wiki article. Often it's path_to_your_webroot/protected/tests/phpunit.xml.

In your IDE: Run → Edit configurations.Follow official PHPUnit installation guide.You should install PHPUnit to run unit tests. If you are writing unit tests you can include PHPUnit to get code completion:.File → Settings → Project settings → PHP → PHP Home → Add.If your project uses common Yii framework folder you need to include it.`File → Settings → Project settings → PHP → PHP Home`. Mark `framework/cli/views`, `protected/runtime` and `assets` as `excluded`. `File → Settings → Project settings → Directories`. Exclude not used directories, specify resources.

`yiilite.php` to `Ignore files and folders`.
