idea执⾏php,idea(+xampp)下php配置debug(亲测有效)idea安装了php插件和PHPstorm没有什么差别,⼀样⽤。
安装xampp,xampp⾃带xdebug,⽆须下载xdebug。
在php.ini配置xdebug;xdebug库⽂件
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"idea debug
;开启远程调试
<_enable = On
;客户机ip
<_host="localhost"
;客户机xdebug监听端⼝和调试协议
<_port=9001
<_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是否有⽤。
说明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项⽬
看效果