Installing Xdebug extension for PHP in CentOS


XdebugyesPHPAn extension of to help developers debug and develop.

Here, take PHP installed by source code compilation as an example, if it isyumoraptFor PHP installation, please refer to the official website:Installation Xdebug

Download Xdebug source code



tar -xzf xdebug-2.9.2.tgz

Compile and install

cd xdebug-2.9.2/ 

implementphpizeCommand, which is usually in thephpInstallation directory forbinUnder the table of contents:


Then there is the compilation and installation/usr/local/php/bin/php-configThe path is also located in thephpIn the installation directory:

./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
make && make install

to configure

findphpconfiguration filephp.iniIt’s usually in thephpInstallation directoryetcAt the end, add:


be careful: if you want to use them togetherXdebugandOPCache, you mustOPCacheAdd after configurationXdebugthat ‘s ok. Otherwise, they will not work properly.


Restart the relevant service (PHP FPM) to make it work, and then you canphpinfo()Page viewXdebugThe module is ready.

It can also be passed under commandphp -mLists all installed modules.