Installing Xdebug on CentOS

本文详细介绍了在CentOS上安装Xdebug的具体步骤,包括安装所需的软件包、编译Xdebug扩展、配置php.ini文件及重启Apache服务等。此外还提供了手动编译最新版Xdebug的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Installing Xdebug on CentOS

Here are exact steps to follow:

1. You need to install PHP’s devel package for PHP commands execution
yum install php-devel
Make sure you also have php-paer package installed
yum install php-pear

2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.
yum install gcc gcc-c++ autoconf automake

3. Compile Xdebug
pecl install Xdebug

4. Find the php.ini file using
locate php.ini

And add the following line

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1

5. Restart Apache
service httpd restart

6. Test if it works – create test.php with the following code

<?php phpinfo() ?>
and check if you have the following output

Summary: You installed XDebug by Derick Rethans as Zend_Extension. Installing XDebug as Zend Extension is very important because that way you can Debug step by step in different IDEs.

If you like to compile the xdebug.so object file yourself in order to get the latest version of xdebug.so here are the steps to follow:

1. Download latest xdebug-X.Y.Z.tgz from xdebug web site

2. Unpack the downloaded file with tar -xvzf xdebug-X.Y.Z.tgz to some test folder

3. Run: cd xdebug-X.Y.Z

4. Run: phpize (to prepare the environment)

5. Run: ./configure

6. Run: make (now you have xdebug.so created;)

7. Copy xdebug.so to your modules file (in my case /usr/lib64/php/modules)

8. Make sure you have the following in php.ini
zend_extension = /usr/lib64/php/modules/xdebug.so

9. Restart the webserver


转自:http://programming-review.com/installing-xdebug-on-centos/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值