Home > Backend Development > PHP Tutorial > Install and configure xdebug extension for php under Centos

Install and configure xdebug extension for php under Centos

不言
Release: 2023-03-29 16:38:02
Original
2585 people have browsed it

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
Copy after login

Unzip

tar zxvf xdebug-2.3.3.tgz
Copy after login

Enter the decompression module

cd xdebug-2.3.3
Copy after login

Create a plug-in module

 /usr/local/php/bin/phpize
Copy after login

Configuration xdebug

./configure –enable-xdebug –with-php-config=/usr/local/php/bin/php-config
Copy after login

Compile and install

make && make install
Copy after login

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.                                                            |
  |                                                                      |
  +----------------------------------------------------------------------+
Copy after login

2. Configure php to support xdebug

Open php.ini

 vi /usr/local/php/etc/php.ini
Copy after login

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  //使用的协议
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template