XAMPP、phpStorm 都直接安装在了D盘根目录,9999m目录建在D:\xampp\htocts下,即目录工程文件夹路径为D:\xampp\htocts99m。在phpStorm>File>open,找到9999m,点击确定,加载9999m到了phpStorm(安装环境路径根据须要自行变动,后面的配置内容也类似)。
1. 开始做事器端配置:安装好XAMPP,停滞apache做事(把稳,如果直接退出XAMPP,是不会停滞apache的)。
2. 在安装目录下找到php.ini,类似于D:\xampp\php\php.ini,并打开。

3. 找到被注释掉的项目(去掉前面的?)并按如下设置:
[XDebug]
==============原代码
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\公众
;zend_extension=\"大众D:\phpStudy\php53n\ext\xdebug.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\"大众
zend_extension=\"大众D:\phpStudy\php53n\ext\xdebug.dll\"大众
xdebug.idekey= PHPSTROM
====================转载的
zend_extension = \公众D:\xampp\php\ext\php_xdebug.dll\公众
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = \"大众D:\xampp\tmp\"大众
xdebug.profiler_output_name = \"大众cachegrind.out.%t-%s\公众
xdebug.remote_enable = on
xdebug.remote_handler = \"大众dbgp\"大众
xdebug.remote_host = \公众127.0.0.1\"大众
xdebug.trace_output_dir = \"大众D:\xampp\tmp\"大众
xdebug.idekey= PHPSTROM
最初的设置是这样的:图2
;的意思是被注释掉了,以是要先去掉;号;
然后开启xdebug.remote_enable = on;
还要增加xdebug.idekey= PHPSTROM。
个中remote_host 是指调试客户真个地址,即IDE所在的IP,同理remote_port 是客户真个端口,这两项在远程调试的情形下把稳修正,远程的时候终极改为:
[XDebug]
zend_extension = \公众D:\xampp\php\ext\php_xdebug.dll\"大众
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = \"大众D:\xampp\tmp\"大众
xdebug.profiler_output_name = \公众cachegrind.out.%t-%s\"大众
xdebug.remote_enable = 1
xdebug.remote_handler = \"大众dbgp\"大众
xdebug.remote_mode = \"大众req\"大众
xdebug.remote_port = 9000
4. 保存文件,重新启动apache检讨是否成功开启了xdebug做事。
一种方法为在CMD里输入D:\xampp\php\php.exe -m 看到XDebug,解释成功开启XDebug。
另一种方法为浏览器打开localhost,找到phpinfo()点击打开配置情形,查找xdebug项,找到相识释xdebug配置成功。