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"

;开启远程调试

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

0c5220721ff7

说明xdebug可用。

在idea配置php

php运行环境

0c5220721ff7

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

0c5220721ff7

Xdebug端口

0c5220721ff7

端口对应php.ini的remote_port。

DBGp Proxy

0c5220721ff7

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

新建php servers

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

0c5220721ff7

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

新建php web application

0c5220721ff7

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

调试

debug监听

0c5220721ff7

xampp apache启动项目

0c5220721ff7

idea debug项目

0c5220721ff7

看效果

0c5220721ff7

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值