Skip to content

Instantly share code, notes, and snippets.

@henryonsoftware
Last active April 16, 2018 08:02
Show Gist options
  • Save henryonsoftware/1afeb09bb4fcbea46f8d9b8ec4a76dfd to your computer and use it in GitHub Desktop.
Save henryonsoftware/1afeb09bb4fcbea46f8d9b8ec4a76dfd to your computer and use it in GitHub Desktop.
Install xdebug on CentOS

Install Xdebug on CentOS

You need to install PHP’s devel package for PHP commands execution

yum install php-devel
yum install php-pear

Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.

yum install gcc gcc-c++ autoconf automake

Compile Xdebug

pecl install Xdebug

Find the php.ini file using

locate php.ini

And add the following line

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1

Restart Apache

service httpd restart

Test if it works – create test.php with the following code

<?php phpinfo() ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment