Updated question : PhpStorm | WebMatrix (IISExpress) | Xdebug.remote_port | — Which Port(s) to put where?
I\'m running localhost web server on my Windows machine w
First check for on what port xdebug is working on, you can find it in your php.ini under xdebug.remote_port=9123
. As you can see in my case it is set to 9123.
Now open PhpStorm go to php debug, see screenshot:
under Xdebug you will find Debug port, make sure that its value is the same as in the php.ini file under xdebug.remote_port
(9123 in my case).
Hope it helps
I had an issue where one project would work and not another one. I tried many different configurations and I tried looking at the logs of xdebug, etc. This fix seems to have resolved my issue:
Try setting your actual ports of xdebug to 9123 instead 9000.
The new version (9) of PHPStorm changed its default xdebug connetion port to 9123 (the PHPSTORM config, not the actual xdebug config), probably for a good reason, since having the PHPSTORM config to the xdebug default 9000 didn't work but having them set to 9123 did work and resolved the issue.
Based on peteclark3 answer:
I think one of solutions if you have multiple php-fpm versions with xdebug, like php5.6-fpm, php7.1-fpm - make sure only one is running. I had both 5.6 and 7.1 running. Then tried to change on 7.1 to 9001 port. But if I change to 9001 port in PhpStorm, then 5.6 starts not working, because it listens on 9000. So each time you change php version, then probably you would need to change setting in phpStorm. So I think it is better to have only one of php-fpm running and all php-fpm versions can use same port.
These lines are crucial to make it work (in php.ini):
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_autostart = 1 # <-------- THIS
xdebug.remote_enable = 1 # <----------- AND THIS
Without these lines xdebug will never work on phpstorm ;)
I tried any of the suggested tricks and finally I called the script by 127.0.0.1/script.php instead of localhost/script.php and bingo!
Right click "Console" tab and uncheck "Focus on startup" (as seen in below image) should do the trick