Eclipse for php + Xdebug搭建PHP的调试环境

第一步:到Eclipse的官网去下载PHP-Eclipse:http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliossr1php

第二步:下载Xdebug (下载地址位于:http://xdebug.org/download.php,个人PHP版本为 PHP 5.3.28 Thread Safety, Apach为2.2.25,使用的端口号8080),我下载的Xdebug版本为php_xdebug-2.2.3-5.3-vc9.dll,而且放入到"PHP/ext目录中。ios

 

    第三步:在PHP5里面找到php.ini,在这个文件的最后面加入以下配置信息:apache

zend_extension = D:\php\ext\php_xdebug-2.2.3-5.3-vc9.dllapp

;zend_extension_ts = D:\php\ext\php_xdebug-2.2.3-5.3-vc9.dlleclipse

;extension = php_xdebug-2.2.3-5.3-vc9.dllssr

[Xdebug]debug

xdebug.auto_trace = On3d

xdebug.show_exception_trace = Oncode

xdebug.remote_autostart = Onblog

xdebug.remote_enable = On

xdebug.collect_vars = On

xdebug.collect_return = On

xdebug.collect_params = On

xdebug.trace_output_dir=”D:/xDebugLog”

xdebug.profiler_output_dir=”D:/xDebugLog”

xdebug.profiler_enable=On

xdebug.remote_host=localhost

xdebug.remote_port=9000

xdebug.remote_handler=dbgp

 

    这里要特别注意:若是在文件里有其余的zend_extension_ts,须要注释掉,不然apache没法启动。

 

    第四步:启动apache。

 

    第五步:在eclipse的项目里的Properties里面找到"PHP Debug",在PHP Debugger里面选择"XDebug"

 

 第六步:再在Windows->Preferences里面配置下PHP Servers

第七步:再在Windows->Preferences里面配置下PHP Executables

    第八步:再在Run->Debug Configurations里面确认Path Mapping的配置和第六步中的一致。

 

   接下来,进入debug界面,就能够开始设置断点进行debug了。

相关文章
相关标签/搜索