分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

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

发布时间:2023-09-06 02:10责任编辑:胡小海关键词:PHPdebug

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

第二步:下载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目录中。

 

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

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

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

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

[Xdebug]

xdebug.auto_trace = On

xdebug.show_exception_trace = On

xdebug.remote_autostart = On

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了。

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

原文地址:https://www.cnblogs.com/hnhycnlc888/p/9484299.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved