第一步:查看PHP版本信息
第二步:到xdebug下载页去下载最新的版本(注意:要下载PHP对应版本)https://xdebug.org/download.php
第三步:把扩展php_xdebug-2.7.0alpha1-7.2-vc15-nts.dll放到php的扩展目录(ext文件中)
我的路径为:D:\phpStudy\PHPTutorial\php\php-7.2.1-nts
第四步:打开php.ini文件,配置如下:
[XDebug]
zend_extension=php_xdebug-2.7.0alpha1-7.2-vc15-nts.dll
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.trace_output_dir ="D:\phpStudy\tmp\xdebug"
xdebug.profiler_output_name = "cache.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.remote_mode = "req"
xdebug.idekey = PHPSTORM
说明:改项也可以写绝对路径
zend_extension=D:\phpStudy\PHPTutorial\php\php-7.2.1-nts\ext\php_xdebug-2.7.0alpha1-7.2-vc15-nts.dll
或者在cmd窗口输入php -m命令查看扩展,注意如果报命令无效时,要添加php.exe到环境变量中