1.在php.ini文件结尾加上 zend_extension = php_xdebug.dll xdebug.remote_enable = On xdebug.remote_host = 127.0.0.1 xdebug.remote_port = 9100 xdebug.remote_autostart = On 2.设置PhpStorm 打开PhpStorm,菜单 File -> Settings ,然后找到 Languages & Frameworks -> PHP -> Debug 设置Debug port为9100 因为9000会和一些集成环境的php-cgi或者php-fpm