Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
install xdebug on centos
http://xdebug.org/install.php#configure-php
http://blog.jetbrains.com/phpstorm/2013/08/debugger-configuration-validation-with-phpstorm/
on CentOS:
1. You need to install PHP’s devel package for PHP commands execution
yum install php-devel
yum install php-pear
2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself.
yum install gcc gcc-c++ autoconf automake
3. Compile Xdebug
pecl install Xdebug
4. 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
5. Restart Apache
service httpd restart
6. Test if it works – create test.php with the following code
<?php phpinfo() ?>
@quamis

This comment has been minimized.

Copy link

@quamis quamis commented Feb 3, 2015

on step #4, it would be "cleaner" to create xdebug.ini in /etc/php.d/ and put in it

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1
@socketpair

This comment has been minimized.

Copy link

@socketpair socketpair commented Jul 30, 2015

Centos 6:

# pecl install Xdebug
pecl/xdebug requires PHP (version >= 5.4.0), installed version is 5.3.3
No valid packages found
install failed
@hisame64

This comment has been minimized.

Copy link

@hisame64 hisame64 commented Sep 4, 2015

socketpair

XDebug supported PHP 5.3 until 2.2.7.
You can install by this command.

# pecl install xdebug-2.2.7
@vasily802

This comment has been minimized.

Copy link

@vasily802 vasily802 commented Jun 21, 2016

Centos 7:
$ yum install php70u-pecl-xdebug

@edinhojorge

This comment has been minimized.

Copy link

@edinhojorge edinhojorge commented Sep 25, 2016

Updated php from 5.3 to 5.4 in centos 6 with this:
https://www.zerostopbits.com/how-to-upgrade-php-5-3-to-php-5-4-on-centos-6-7/

@technocrusaders

This comment has been minimized.

Copy link

@technocrusaders technocrusaders commented Oct 9, 2016

This is what i did:

  1. yum install php-devel
  2. follow the steps in the x debug wizard at https://xdebug.org/wizard.php
@radub

This comment has been minimized.

Copy link

@radub radub commented Apr 3, 2018

pecl/xdebug requires PHP (version >= 7.0.0), installed version is 5.5.38
No valid packages found
install failed
@abdelatnova

This comment has been minimized.

Copy link

@abdelatnova abdelatnova commented Apr 4, 2018

@radub you can take a look at the supported php version for each xdebug version at https://xdebug.org/download.php for your version it's 2.5.5. You can install that using pecl install Xdebug-2.5.5

@killrazor

This comment has been minimized.

Copy link

@killrazor killrazor commented Apr 4, 2018

We have PHP version 5.4.x so I used pecl install xdebug-2.4.1 instead. Found using the link above from @abdelatnova. Everything else went great.

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