While using PhpStorm I tried to use remote PHP interpreter on my dev virtual machine. As I’m big openSUSE fan and user I have openSUSE Leap 42.1 as my development machine. Unfortunately there is no Xdebug for PHP distributed by default.

However, there is repository available, so it’s easy to add this missing component to my system.

Here is how…

Repositories with php5-xdebug is located here:

http://software.opensuse.org/package/php5-xdebug

You can easy located your distribution, then expand particular section and you will see 1-Click Install.

Copy that link into terminal window and download it on your virtual machine and then rename it to some friendly and easy to use name.

dev-lnx-01:~ # wget http://software.opensuse.org/ymp/server:php:extensions/openSUSE_Leap_42.1/php5-xdebug.ymp?base=openSUSE%3ALeap%3A42.1&query=php5-xdebug
dev-lnx-01:~ # ls -l
total 24
-rw------- 1 root root 4951 Mar 18 07:44 .bash_history
-rw-r--r-- 1 root root  114 Mar 17 18:23 .bash_profile
drwx------ 1 root root   20 Mar 17 16:55 .cache
drwxr-xr-x 1 root root  132 Mar 17 16:56 .composer
drwx------ 1 root root    4 Mar 17 16:58 .config
drwx------ 1 root root    0 Sep 30 12:59 .gnupg
drwxr-xr-x 1 root root   10 Dec 24 16:00 .local
drwxr-xr-x 1 root root   80 Mar 22 19:28 .phpstorm_helpers
drwxr-xr-x 1 root root   20 Mar 17 16:58 .vim
-rw------- 1 root root 5270 Mar 22 19:34 .viminfo
drwxr-xr-x 1 root root    0 Sep 30 12:59 bin
drwxr-xr-x 1 root root  370 Mar 17 17:38 blog
drwxr-xr-x 1 root root   26 Mar 17 16:55 composer
drwxr-xr-x 1 root root   46 Dec 24 13:14 inst-sys
-rw-r--r-- 1 root root 1941 Mar 22 19:49 php5-xdebug.ymp?base=openSUSE:Leap:42.1
dev-lnx-01:~ # ren php5-xdebug.ymp\?base\=openSUSE\:Leap\:42.1 php5-xdebug.ymp

Once renamed you can import repository information and install php5-xdebug using OCICLI.

dev-lnx-01:~ # OCICLI file:///root/php5-xdebug.ymp
If you continue, the following repositories will be subscribed:
* http://download.opensuse.org/repositories/server:/php:/extensions/openSUSE_Leap_42.1/
* http://download.opensuse.org/update/leap/42.1/oss/
If you continue, the following software packages will be installed:
* php5-xdebug
Continue? y/N
y
Adding Repositories...

Now you will have php5-xdebug installed and PhpStorm will be happy.

Last thing to do on server side is to configure Xdebug in /etc/php5/conf.d/xdebug.ini.

You might want to adjust some parameters like:

  • xdebug.remote_connect_back = 1
  • xdebug.remote_enable = 1

Hope that helps with PhpStorm and php5-xdebug installation on openSUSE Leap 42.1.