PHPstudy + phpstorm 配置xdebug

本文详细介绍了在Windows环境下使用Xdebug进行性能分析及调试的配置方法,包括不同PHP环境下的配置步骤,如php5.5.38+Apache与php5.6.31+Apache的配置差异,并给出了phpStorm中的相应设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

window10+phpstudy >>> php5.5.38 + Apache

php.ini配置

;性能分析文件的存放位置,默认值为/tmp

xdebug.profiler_output_dir="E:\phpStudy\tmp\xdebug"

;函数调用跟踪信息输出文件目录,默认值为/tmp
xdebug.trace_output_dir="E:\phpStudy\tmp\xdebug"
zend_extension="E:\phpStudy\php\php-5.5.38\ext\php_xdebug.dll"

#新增xdebug配置
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_mode = "req"

#端口设置需要与phpstrom中的设置一致
xdebug.remote_port = 9000  

xdebug.idekey=PHPSTORM

window10+wamp>>> php5.6.31 + Apache

[xdebug]
zend_extension="c:/wamp64/bin/php/php5.6.31/zend_ext/php_xdebug-2.5.5-5.6-vc11-x86_64.dll"
xdebug.remote_enable = On
xdebug.idekey=phpstorm 
xdebug.remote_enable = On 
xdebug.remote_host=localhost 
;xdebug.remote_port默认值为9000,这里需要跟phpstorm配置一致,下面有说明 
xdebug.remote_port=9000 
xdebug.remote_handler= "dbgp" 
xdebug.auto_trace = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="c:/wamp64/tmp"
xdebug.show_local_vars=0

 

phpstrom设置

 

php languagel level: 这个是PHP的版本 
cli interpreler 选择PHP的文件所在位置,最后选择为php-cgi.exe 文件

选择php.exe位置

 

 

原有的配置文件不变,主要看Debug port 端口号,要与PHPinfo 里的xdebug port端口号一致

 

 

 

Ied key : 这里要查看phpinfo里的xdebug 的key是什么,要写的一致 
host:你的访问域名或者 localhost 
port:你项目的端口是多少就写多少

 

 

 

Name:随便命名
host:项目的访问路径 
prot:项目的端口 
debugger:选择xdebug

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值