If you need to install Xdebug on openSUSE and don’t want ot use existing binary repo easiest way is to use pecl to do that and here is how…

First install all required packages

dev-lnx-02:~ # zypper --non-interactive install gcc autoconf automake php5 php5-pear php5-devel

Now we can download and install Xdebug itself:

dev-lnx-02:~ # pecl install xdebug

downloading xdebug-2.4.1.tar ...
Starting to download xdebug-2.4.1.tar (1,238,528 bytes)
.....................................................................................................................................................................................................................................................done: 1,238,528 bytes
76 source files, building
running: phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
building in /tmp/pear/temp/pear-build-rootL9Irar/xdebug-2.4.1

... and some more steps ...

Libraries have been installed in:
/tmp/pear/temp/pear-build-rootL9Irar/xdebug-2.4.1/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

running: make INSTALL_ROOT="/tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1" install
Installing shared extensions:     /tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1/usr/lib64/php5/extensions/

+----------------------------------------------------------------------+
|                                                                      |
|   INSTALLATION INSTRUCTIONS                                          |
|   =========================                                          |
|                                                                      |
|   See http://xdebug.org/install.php#configure-php for instructions   |
|   on how to enable Xdebug for PHP.                                   |
|                                                                      |
|   Documentation is available online as well:                         |
|   - A list of all settings:  http://xdebug.org/docs-settings.php     |
|   - A list of all functions: http://xdebug.org/docs-functions.php    |
|   - Profiling instructions:  http://xdebug.org/docs-profiling2.php   |
|   - Remote debugging:        http://xdebug.org/docs-debugger.php     |
|                                                                      |
|                                                                      |
|   NOTE: Please disregard the message                                 |
|       You should add "extension=xdebug.so" to php.ini                |
|   that is emitted by the PECL installer. This does not work for      |
|   Xdebug.                                                            |
|                                                                      |
+----------------------------------------------------------------------+


running: find "/tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1" | xargs ls -dils
2566    0 drwxr-xr-x 1 root root       6 Sep 28 20:20 /tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1
3066    0 drwxr-xr-x 1 root root      10 Sep 28 20:20 /tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1/usr
3067    0 drwxr-xr-x 1 root root       8 Sep 28 20:20 /tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1/usr/lib64
3068    0 drwxr-xr-x 1 root root      20 Sep 28 20:20 /tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1/usr/lib64/php5
3069    0 drwxr-xr-x 1 root root      18 Sep 28 20:20 /tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1/usr/lib64/php5/extensions
3070 1108 -rwxr-xr-x 1 root root 1133640 Sep 28 20:20 /tmp/pear/temp/pear-build-rootL9Irar/install-xdebug-2.4.1/usr/lib64/php5/extensions/xdebug.so

Build process completed successfully
Installing '/usr/lib64/php5/extensions/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.4.1
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=xdebug.so" to php.ini
dev-lnx-02:~ #

Once we have Xdebug compiled we need to add this to php.ini configuration, so Apache Web Server can load it and allow to use it.

In order to do that add following lines at the end of /etc/php5/apache2/php.ini file:

; XDebug configuration
zend_extension=/usr/lib64/php5/extensions/xdebug.so
[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1

and then reload Apache Web Server

dev-lnx-02:~ # service apache2 restart

Once it’s done you can just check with phpinfo(); status of Xdebug and you should see results similar to shown below:

 

Enjoy Xdebug now 🙂 Similar methodology applies to other distros once you have pecl installed.