idea(+xampp)下php配置debug(亲测有效)

2020-02-16  本文已影响0人  molaoye

idea安装了php插件和PHPstorm没有什么差别,一样用。

安装xampp,xampp自带xdebug,无须下载xdebug。

在php.ini配置xdebug

;xdebug库文件

zend_extension = "C:\xampp\php\ext\php_xdebug.dll"

;开启远程调试

xdebug.remote_enable = On

;客户机ip

xdebug.remote_host="localhost"

;客户机xdebug监听端口和调试协议

xdebug.remote_port=9001

xdebug.remote_handler=dbgp

;idekey 区分大小写

xdebug.idekey="PHPSTORM"

xdebug.profiler_enable = off

xdebug.profiler_enable_trigger = off

xdebug.profiler_output_name = cachegrind.out.%t.%p

xdebug.profiler_output_dir = "d:\tmp"

用xampp的apache运行C:/xampp/htdocs,检查xdebug是否有用。

在这里查看http://localhost/dashboard/phpinfo.php

说明xdebug可用。

在idea配置php

php运行环境

CLI Interpreter的选项是点“...”添加而来的:

Xdebug端口

端口对应php.ini的remote_port。

DBGp Proxy

ide key对应php.ini的idekey,host对应php.ini的remote_host,port对应Xdebug端口。

新建php servers

新建php servers运行项php web application才会出来。


host对应php.ini的remote_host,port对应apache里项目端口,debugger选xdebug。

新建php web application

选择刚才新建的server,start url这个很关键,路径不对不是404就是找不到服务,参照apache项目的访问路径。

调试

debug监听

xampp apache启动项目

idea debug项目

看效果

参考:https://blog.csdn.net/yinhangbbbbb/article/details/79247331

上一篇 下一篇

猜你喜欢

热点阅读