Method of Ubuntu Environment Source Code Compilation and Installation of xdebug

  • 2021-07-01 08:39:51
  • OfStack

This paper describes the method of compiling and installing xdebug source code in Ubuntu environment. Share it for your reference, as follows:

In front of the introduction of Ubuntu environment compilation and installation of PHP and Nginx method, here again to explain 1 source code compilation and installation of xdebug method.

Download and unzip xdebug

Download address of xdebug: https://xdebug.org/download.php

I downloaded 2.3. 3. Actually, I didn't know the difference between these versions, so I downloaded one casually.


cd /usr/local/src
wget https://xdebug.org/files/xdebug-2.3.3.tgz
tar -zxvf xdebug-2.3.3.tgz

Compile and install xdebug

php is installed under the/opt/php path


cd /usr/local/src/xdebug-2.3.3
/opt/php/bin/phpize
./configure --prefix=/opt/xdebug --with-php-config=/opt/php/bin/php-config
make && make install

After the installation is successful, the following information will be displayed:

Installing shared extensions:
/opt/php/lib/php/extensions/no-debug-non-zts-20131226/

Configuring php. ini

We add the xdebug extension at the end of php. ini:


zend_extension=/opt/php/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so

Restart nginx to take effect.

If you cannot find php. ini, you can use the /opt/php/bin/php -i |grep php.ini Find the path information of php. ini. If there is no php. ini file in the corresponding path, you can use it from cpoyN1 copies of php. ini-development or php. ini-production in the decompressed php source code.

I hope this article is helpful to everyone's Ubuntu environment configuration.


Related articles: