WIN7+wampserver2.4+zend stadio10.6.1配置Xdebug

一、前言

zend stadio调试很不方便,php5.3版本之前可使用zend debuger调试,php5.3以后就需要使用XDebug调试了。下面介绍我配置的经验,希望帮助更多的人

二、配置步骤

1、打开WampServer-PHP-php.ini

在最下面加入如下内容:

; XDEBUG Extension


[Xdebug]  
zend_extension = "c:/wamp/bin/php/php5.4.12/zend_ext/php_xdebug-2.2.3-5.4-vc9-x86_64.dll" 
xdebug.auto_trace= "On" 
xdebug.collect_params= "On" 
xdebug.collect_return= "On"  
xdebug.trace_output_dir="c:/wamp/tmp" 
xdebug.profiler_enable= "true"  
xdebug.profiler_output_dir="c:/wamp/tmp" 
xdebug.profiler_append = 1  
xdebug.profiler_enable_trigger = 1  
xdebug.profiler_output_name = "cachegrind.out.%t-%s" 
xdebug.remote_enable= "On"   
xdebug.remote_enable= 1
xdebug.remote_autostart = "On"    
xdebug.remote_host=localhost  
xdebug.remote_port=9000   
xdebug.remote_handler = "dbgp"

其中要注意的几项是:zend_extension后面的内容是安装wampserver后自带的xdebug文件。remote_host是主机名可以是远程的ip地址或者本机localhost。remote_port为端口号,通常为9000。

ok,保存。

2、重启apache服务器 通过运行phpinfo()看到如下信息,证明配置成功

3、配置zend stadio

选择window-Preference-php Executables点击Add

按照如下选择

接下来选择window-Preference-php Servers点击New

按照如下设置服务

接下来选择window-Preference-Debug-Installed Debug设置端口号

下面window-Preference-Debug设置我们上面配置好的PHP Excutables和PHP Servers

点击界面上方的小爬虫,选择下面的Debug Configarations

配置里面要调试的页面

截下来切换选项卡Debuger,选择XDebug

到此为止我们就配置完毕了。

选择小爬虫-Debug As-PHP Web Application调试我们的页面

至此我们实现了使用XDebug调试,如果大家有什么疑问或者更好的建议,欢迎提出

原文地址:https://www.cnblogs.com/no27/p/4211863.html