This article describes how to compile and install xdebug from source code in Ubuntu environment. Share with you for your reference, as follows:
I introduced the method of compiling and installing PHP and Nginx in the Ubuntu environment. Here, I will explain the method of compiling and installing xdebug from the source code.
Download and unzip xdebug
xdebug download address: https://xdebug.org/download.php
I downloaded 2.3.3, but I don’t know the difference between these versions, so I just downloaded one.
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/
Configure 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 can’t find php.ini, you can use /opt/php/bin/php -i |grep php.ini
to find the path information of php.ini. If the corresponding path does not have a php.ini file, you can use the extracted php In the source code, cpoy has a copy of php.ini-development or php.ini-production for use.
I hope this article will help you configure your Ubuntu environment.
Recommended Posts