How to install XAMPP and PhpStorm on OpenSUSE 12.1

XAMPP is a cross-platform PHP web-app development stack for Windows, Linux, Apple Mac OS X and Solaris.

PhpStorm is a commercial cross-platform IDE for developing PHP web applications.

Software Versions

 * OpenSUSE 12.1
 * PhpStorm 4.0.1
 * xampp-linux-1.7.7.tar.gz (PHP 5.3)

Install PhpStorm

 * Install Sun Java JRE 1.6.0 using YaST (e.g. java-1_6_0-sun)
 * Download PhpStorm from JetBrains (e.g. PhpStorm-4.0.1.tar.gz)
 * Login as root and unpack the PhpStorm .tar.gz file to /opt


 * 1) tar xvfz PhpStorm-4.0.2.tar.gz -C /opt


 * Create ~/bin/phpstorm.sh bash shell script file for starting PhpStorm

JDK_HOME=/usr/lib64/jvm/jre-sun export JDK_HOME /opt/PhpStorm-117.474/bin/phpstorm.sh &
 * 1) ! /bin/bash
 * 2) start PhpStorm
 * 1) set path to JRE for PhpStorm
 * 1) start PhpStorm


 * Set the shell script file to be executable

> chmod 744 phpstorm.sh

Install XAMPP

 * Download the latest XAMPP for Linux release from Apache Friends.
 * Beta releases are not obviously linked on the XAMPP website, but can be accessed from the Apache Friends XAMPP BETA page, or from the XAMPP SourceForge project Files page under BETAS.


 * Login as root and extract the downloaded archive file to /opt:


 * 1) tar xvfz xampp-linux-1.7.7.tar.gz -C /opt


 * Set the permissions on /opt/lampp/htdocs/ so that everyone (e.g., you and the Apache web server) has write permission to htdocs/

It would arguably be more secure to create a new group, add the web server user and your userid to the group, change the group owner of htdocs/ to the new group, and finally add group write permission to htdocs/ - but that would also be a lot more complicated and there is minimal risk on a development workstation.


 * 1) chmod -R 777 /opt/lampp/lampp/htdocs/

32-bit System
This procedure will not work on a 64bit system because XAMPP is distributed compiled as 32-bit and Xdebug will be compiled as 64bit.


 * Run YaST and install gcc and make (needed to build XDebug, which is not included in the XAMPP for Linux tarball)


 * Download XAMPP for Linux development package from Apache Friends. Extract it and copy the "include" folder to the XAMPP installation directory, then delete the extracted development package.
 * Development packages are not available for Beta releases.


 * 1) tar xvfz xampp-linux-devel-1.7.7.tar.gz -C /tmp
 * 2) cp -r /tmp/lampp/include/ /opt/lampp/
 * 3) rm -r /tmp/lampp/


 * Update the pecl channels database


 * 1) /opt/lampp/bin/pecl update-channels


 * Install Xdebug (xdebug.so will be created in /opt/lampp/lib/php/extensions/ - e.g. no-debug-non-zts-20090626/xdebug.so)


 * 1) /opt/lampp/bin/pecl install Xdebug


 * Edit php.ini and add an [Xdebug] section with the following lines (xdebug.manual_url is optional but if used, typically refers to your closest mirror):

[Xdebug] zend_extension="/opt/lampp/lib/php/extensions/path_to_xdebug.so" xdebug.remote_enable = 1 xdebug.manual_url = "http://ca.php.net"

64-bit System
The 32-bit procedure will not work on a 64bit system because XAMPP is distributed compiled as 32-bit and Xdebug will be compiled as 64bit.


 * Download the Linux 32-bit PHP Remote Debugging Package from Active State. The package includes compiled 32-bit xdebug.so files for recent PHP releases.


 * Extract the contents of the tar file and copy the appropriate xdebug.so (e.g. 5.3) file to /opt/lampp/lib/php/extensions/xdebug.so


 * Edit php.ini and add an [Xdebug] section with the following lines (xdebug.manual_url is optional but if used, typically refers to your closest mirror):

[Xdebug] zend_extension="/opt/lampp/lib/php/extensions/xdebug.so" xdebug.remote_enable = 1 xdebug.manual_url = "http://ca.php.net"

Start XAMPP

 * Start XAMPP from command shell (must be root)


 * 1) /opt/lampp/lampp start

or start XAMPP control panel


 * 1) /opt/lampp/lampp panel

Check phpinfo from the local XAMPP home page and confirm xdebug is enabled.

Configure PhpStorm with XDebug

 * Click the ''PHP Listen debug connections'’ button.
 * Follow the JetBrains blog post Zero-configuration debugging with XDebug and PhpStorm 2.0