WIN7+wampserver2.4+zend stadio10.6.1配置Xdebug
一、前言zend stadio调试很不方便,php5.3版本之前可使用zend debuger调试,php5.3以后就需要使用XDebug调试了。下面介绍我配置的经验,希望帮助更多的人
二、配置步骤
1、打开WampServer-PHP-php.ini
在最下面加入如下内容:
; XDEBUG Extension
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()看到如下信息,证明配置成功
http://images.cnitblog.com/blog/680322/201501/082007140622273.bmp
3、配置zend stadio
选择window-Preference-php Executables点击Add
http://images.cnitblog.com/blog/680322/201501/082020085159939.gif
按照如下选择
http://images.cnitblog.com/blog/680322/201501/082015522036343.gif
接下来选择window-Preference-php Servers点击New
http://images.cnitblog.com/blog/680322/201501/082023374683969.gif
按照如下设置服务
http://images.cnitblog.com/blog/680322/201501/082024473904175.gif
接下来选择window-Preference-Debug-Installed Debug设置端口号
http://images.cnitblog.com/blog/680322/201501/082027113431396.gif
下面window-Preference-Debug设置我们上面配置好的PHP Excutables和PHP Servers
http://images.cnitblog.com/blog/680322/201501/082029163288645.gif
点击界面上方的小爬虫,选择下面的Debug Configarations
http://images.cnitblog.com/blog/680322/201501/082034275154043.gif
配置里面要调试的页面
http://images.cnitblog.com/blog/680322/201501/082036484842011.gif
截下来切换选项卡Debuger,选择XDebug
http://images.cnitblog.com/blog/680322/201501/082038598756168.gif
到此为止我们就配置完毕了。
选择小爬虫-Debug As-PHP Web Application调试我们的页面
http://images.cnitblog.com/blog/680322/201501/082044002818160.gif
至此我们实现了使用XDebug调试,如果大家有什么疑问或者更好的建议,欢迎提出
页:
[1]