If you are developing PHP using PHPStorm and IIS and need to debug it, here is what to do. PHP, IIS, PHPStorm should already be installed and configured. This is a short tutorial and I wrote it as there is none available on the net, that is:
- for windows developers, and
Step 1: Installing xDebug Extension
Download the xDebug extension for PHP from https://xdebug.org/download.php. Choose the version that is the same as the PHP version you are using.
GO to your PHP.ini and insert the following lines at the bottom of the ini file:
Search for the
extension= entries and add:
Set the correct path for
profile_output_dir (some temp path) and
zend_Extension (the full path to the extension).
Step 2: Install the xDebug Browser Extension
Open the HTML browser you are using and install the xDebug add on.
For Firefox and Chrome, I'm using: XDebug Helper by Brain Gilbert.
After that, go to the Options of the extension and set its "
IDEKey" to "
Step 3: Configure IIS
Open IIS, choose your sever, go to Fast CGI Settings, double click it, double click on the PHP version you have configured. Now go to "
Processmodel" and search for
Activity timeout and
Request timeout. Set it to something useful. I set it to
600, so you will have 10 minutes for debugging. If you do not make this setting, then you will timeout after 60 seconds.
Step 4: Connect with PHPStorm
Open PHPStorm. Open the Page you want to debug in your configured browser. In PHPStorm, click listen for PHP Debug connections Tool Button (it looks like a telephone handle). In Browser, start xDebug in Debug Mode. Now in PHPStorm, a message shows up to accept the incoming from xDebug connection. Confirm it.
If it does not come up, maybe PHPStorm is misconfigured. In its default settings, it should work flawlessly.
:-D Now you are done. Happy debugging!