Home > Article > Backend Development > Install and configure xdebug extension for php under Centos
This article mainly introduces the xdebug extension for php installation and configuration under Centos. It has a certain reference value. Now I share it with you. Friends in need can refer to it
1. Download and install xdebug
Get xdebug
wget http://www.xdebug.org/files/xdebug-2.3.3.tgz
Unzip
tar zxvf xdebug-2.3.3.tgz
Enter the decompression module
cd xdebug-2.3.3
Create a plug-in module
/usr/local/php/bin/phpize
Configuration xdebug
./configure –enable-xdebug –with-php-config=/usr/local/php/bin/php-config
Compile and install
make && make install
Follow the above steps to install. If there are no special circumstances, the installation will go smoothly. The final result is the following, which means the installation is successful
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/ +----------------------------------------------------------------------+ | | | INSTALLATION INSTRUCTIONS | | ========================= | | | | See http://xdebug.org/install.php#configure-php for instructions | | on how to enable Xdebug for PHP. | | | | Documentation is available online as well: | | - A list of all settings: http://xdebug.org/docs-settings.php | | - A list of all functions: http://xdebug.org/docs-functions.php | | - Profiling instructions: http://xdebug.org/docs-profiling2.php | | - Remote debugging: http://xdebug.org/docs-debugger.php | | | | | | NOTE: Please disregard the message | | You should add "extension=xdebug.so" to php.ini | | that is emitted by the PECL installer. This does not work for | | Xdebug. | | | +----------------------------------------------------------------------+
2. Configure php to support xdebug
Open php.ini
vi /usr/local/php/etc/php.ini
Add configuration information
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so [Xdebug] xdebug.remote_enable = 1 //开启远程调试 xdebug.remote_host = 192.168.17.90 //远程ip地址抑或是本机地址 xdebug.remote_port = 9000 //远程IDE服务器监听端口 xdebug.remote_handler=DBGP //使用的协议
The php script uses phpinfo() to view the php configuration as shown below, indicating that the configuration is successful
##
The above is the detailed content of Install and configure xdebug extension for php under Centos. For more information, please follow other related articles on the PHP Chinese website!