Centos 下php安装配置xdebug扩展

1、下载安装xdebug

获取xdebug

wget http://www.xdebug.org/files/xdebug-2.3.3.tgz 

解压

tar zxvf xdebug-2.3.3.tgz

进入解压模块

cd xdebug-2.3.3

建立外挂模块

 /usr/local/php/bin/phpize

配置xdebug

./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config

编译安装

make && make install

按照上述步骤安装,如果没有什么特殊情况的话安装会顺利的进行,最后出现如下结果表示安装成功

  1.  
    Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
  2.  
    +----------------------------------------------------------------------+
  3.  
    | |
  4.  
    | INSTALLATION INSTRUCTIONS |
  5.  
    | ========================= |
  6.  
    | |
  7.  
    | See http://xdebug.org/install.php#configure-php for instructions |
  8.  
    | on how to enable Xdebug for PHP. |
  9.  
    | |
  10.  
    | Documentation is available online as well: |
  11.  
    | - A list of all settings: http://xdebug.org/docs-settings.php |
  12.  
    | - A list of all functions: http://xdebug.org/docs-functions.php |
  13.  
    | - Profiling instructions: http://xdebug.org/docs-profiling2.php |
  14.  
    | - Remote debugging: http://xdebug.org/docs-debugger.php |
  15.  
    | |
  16.  
    | |
  17.  
    | NOTE: Please disregard the message |
  18.  
    | You should add "extension=xdebug.so" to php.ini |
  19.  
    | that is emitted by the PECL installer. This does not work for |
  20.  
    | Xdebug. |
  21.  
    | |
  22.  
    +----------------------------------------------------------------------+

2、配置php支持xdebug

打开php.ini

 vi /usr/local/php/etc/php.ini

添加配置信息

  1.  
    zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
  2.  
    [Xdebug]
  3.  
    xdebug.remote_enable = 1 //开启远程调试
  4.  
    xdebug.remote_host = 192.168.17.90 //远程ip地址抑或是本机地址
  5.  
    xdebug.remote_port = 9000 //远程IDE服务器监听端口
  6.  
    xdebug.remote_handler=DBGP //使用的协议

php脚本使用phpinfo()查看php的配置如下图,说明配置成功

posted on   Hi,王松柏  阅读(230)  评论(0编辑  收藏  举报

编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示