Debug yii2 project with XDebug and PHPStorm

add Xdebug for PHP

docs of adding Xdebug for PHP can be found here, and then add the following config section to php.ini:

xdebug.default_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_enable = 1
xdebug.remote_port = 9001

and make sure that Xdebug is enabled by checking phpinfo():


add local PHP interpreter setting


add PHP server setting


update Xdebug setting


add PHPStorm Run/Debug configuration


add break point


start listening

Leave a Reply

Your email address will not be published. Required fields are marked *