教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 xampp启用xdebug学习笔记详解

xampp启用xdebug学习笔记详解

发布时间:2016-10-26   编辑:jiaochengji.com
教程集为您提供xampp启用xdebug学习笔记详解等资源,欢迎您收藏本站,我们将为您提供最新的xampp启用xdebug学习笔记详解资源
本文章来给各位同学介绍关于启用xdebug的具体方法,有需要了解的朋友可进入参考。
今天早上弄xdebug折腾了有一会,记录一下,以后好找。
环境:
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy2910')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy2910>
Windows 7 Business Edition Service Pack 1(64位)
XAMPP v3.2.1
这个版本的XAMPP,自带的php_debug.dll模块启用不了,总是报错,就去xdebug.org下载。
试了好几个版本才找到能用的
下好之后,一个个试,有的报错无法运行,有的不报错,但是phpinfo()里面没有显示已经加载了xdebug。
只有php_xdebug-2.2.3-5.4-vc9.dll可以使用(话说我一个64位系统,为啥运行的是32位的dll,难道和我的php版本有关?感觉xampp自带的php是32位编译出来的)。
安装Xdebug
把下好的Xdebug放到php目录的ext文件夹下面,然后修改php.ini。
 
<textarea wrap="off" readonly="readonly" data-settings="dblclick" jquery11020184742318790182="19">[Xdebug] zend_extension="d:/xampp/php/ext/php_xdebug-2.2.3-5.4-vc9.dll"</textarea>
<table> <tbody> <tr> <td data-settings="show">
1
2
</td> <td>
[Xdebug]
zend_extension="d:/xampp/php/ext/php_xdebug-2.2.3-5.4-vc9.dll"
</td> </tr> </tbody> </table>
重启Apache后再看phpinfo,有xdebug选项即表示xdebug模块已启用(我的是win下面的xampp,如如果是Linux,可能还需要重启php服务,例如php-fpm模式的时候)。
使结果输出到IDE上面
先打开xdebug的远程模式,编辑php.ini,完整配置如下:
 
<textarea wrap="off" readonly="readonly" data-settings="dblclick" jquery11020184742318790182="44">[Xdebug] zend_extension="d:/xampp/php/ext/php_xdebug-2.2.3-5.4-vc9.dll" xdebug.remote_enable = On xdebug.remote_host = 127.0.0.1 xdebug.remote_port = 9000 xdebug.remote_handler = "dbgp"</textarea>
<table> <tbody> <tr> <td data-settings="show">
1
2
3
4
5
6
</td> <td>
[Xdebug]
zend_extension="d:/xampp/php/ext/php_xdebug-2.2.3-5.4-vc9.dll"
xdebug.remote_enable = On
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.remote_handler = "dbgp"
</td> </tr> </tbody> </table>
如上重启,接着配置IDE,我这里以phpstorm为例。
File -> Settings -> PHP -> Servers
如图配置即可
Run -> edit configurations
新建一个PHP Web Application配置
如图,编辑自己的配置

您可能感兴趣的文章:
xampp启用xdebug学习笔记详解
xampp开启xampp Mysql数据库等的远程访问例子
xampp需要另外安装php吗?
xdebug调试PHP程序的学习笔记
Mac系统下用Apache和PHP安装Xdebug详细流程
xampp集成环境中php的date()函数获取时间错误的解决办法
Mac Apache PHP安装Xdebug方法步骤
php中在虚拟机环境下使用xdebug注意事项
避坑!用 Docker 搞定 PHP 开发环境搭建
常用的php集成环境有哪些

[关闭]
~ ~