How to install XAMPP and PhpStorm on Linux Mint 13 (64 bit)

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.

Tested With
 * Linux Mint 13 (Maya)
 * PhpStorm 4.0.3
 * xampp-linux-1.8.0.tar.gz (PHP 5.4)

Install Oracle JRE 7 (1.7)

 * As of PhpStorm 4.0.3, PhpStorm no longer warns of stability problems when run under OpenJDK instead of Oracle JRE/JDK.

PhpStorm warns of stability problems when run under OpenJDK instead of Oracle JRE/JDK, and is reportedly significantly faster running on JRE/JDK 7 than JRE/JDK 6.


 * Download the Java SE 7 JRE (Java Runtime Environment) tar.gz tarball from Oracle
 * Install Java SE 7 JRE (follow instructions in reference below)

Install PhpStorm

 * Download PhpStorm from JetBrains (e.g. PhpStorm-4.0.2.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


 * Edit your user ~/.bashrc and add the following lines to define JDK_HOME so PhpStorm can find Java SE JRE 7, and to add an alias for running PhpStorm (using nohup frees the terminal window for other use, but also is a safety measure to prevent PhpStorm from being killed if the terminal window is closed).

JDK_HOME=/usr/lib64/jvm/jre-sun export JDK_HOME alias phpstorm='nohup /opt/PhpStorm-117.501/bin/phpstorm.sh &'
 * 1) PhpStorm
 * 2) set path to Java SE JRE 7
 * 1) set alias for starting PhpStorm

The 32-bit JRE path (installing jre-7u5-linux-i586.rpm) was JDK_HOME=/usr/lib/jvm/jre


 * Reload your bash environment

> . ./.bashrc

Install XAMPP

 * Download the latest XAMPP for Linux release from Apache Friends.


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


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


 * Install 32-bit compatibility libraries

> sudo apt-get install ia32-libs


 * It appears the current philosophy is for source packages to follow the Multiarch specification instead of using the "monstrous" ia32-libs package.


 * 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/htdocs/

Install XDebug
The XDebug project doesn't distribute binaries for Linux systems. Typical instructions to install XDebug will compile XDebug from source. However, on 64-bit Fedora system XDebug will be compiled as a 64-bit binary, which will conflict with the 32-bit XAMPP/LAMPP. In this case, the simplest solution is to use a pre-compiled 32-bit XDebug from Active State (which may also be simplest solution on 32-bit Fedora).


 * Download the Linux 32-bit PHP Remote Debugging Package from Active State (e.g. Komodo-PHPRemoteDebugging-7.0.2-70257-linux-x86.tar.gz). 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.4/xdebug.so) file to /opt/lampp/lib/php/extensions/xdebug.so


 * Edit php.ini and add an [Xdebug] section with the following lines (xdebug.manual_url can also be set if desired to your closest mirror, e.g. xdebug.manual_url = "http://ca.php.net" ).

[Xdebug] zend_extension="/opt/lampp/lib/php/extensions/xdebug.so" xdebug.remote_enable = 1

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

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