Update/Upgrade/Install XAMPP (LAMPP) modules by Compiling

Linux
PHP
Sys Administration

This article is not finished yet and it might not work for you at all, if you're still interested you can subscribe to its rss so you will be notified whenever i update it.

I also recommend using Virtual Machines like VirtualBox for this kind of purposes if you like to keep your system clean.

XAMPP source code http://www.nat32.com/xampp/index.htm

http://www.apachefriends.org/f/viewtopic.php?f=16&t=34411

In Linux preparing a complete webserver is quite easy and it does not require much time. But sometimes dependency issues and different versions may cause some trouble, this is where xampp comes in, XAMPP is a very useful piece of software for developers and regular users which allows installing a complete standalone Web Server in few minutes. But the Linux version of this software does not support addons , so upgrading its modules or installing new ones is not possible without compiling,unfortunately XAMPP developers don't like to share the source code of XAMPP it self so you cannot build our own customized version , so i'm going to describe how to overcome this problem.

Xampp 1.7.2 comes with PHP 5.3.0 which is stil buggy so i'm going to install PHP 5.2.11 under XAMPP (I could recompile 5.3 RC2 but i don't want to recompile for every issue i find!)

This tutorial is written under Kubuntu(Debian based) and i will assume that LAMPP is installed in /opt/lampp which is the folder for manually installed softwares

PHP depends on Apache , so i'm going to install the latest version of Apache as well

Requirements

sudo apt-get install make
sudo apt-get install libcurl4-openssl-dev

Step 1 / Compiling apache

wget http://datadispensary.com/apache/httpd/httpd-2.2.14.tar.gz
tar -xzf httpd-2.2.14.tar.gz
sudo mv httpd-2.2.14 /usr/src/httpd-2.2
cd /usr/src/httpd-2.2
./configure --enable-so --prefix=/opt/lampp
make
make install

Step 2 / Downloading source code

Download PHP's source code from here and extract it in /usr/share
wget http://us2.php.net/distributions/php-5.2.11.tar.gz
tar -xzf php-5.2.11.tar.gz
sudo mv php-5.2.11 /usr/src/php-5.2

Step 3 / Finding configuration

We need to find the configuration of already installed version , so we can use it install the new version with the exact same configuration

/opt/lampp/bin/php --info | grep "Configure Command"

You should see something like this as result :

'./configure'  '--prefix=/opt/lampp' '--with-apxs2=/opt/lampp/bin/apxs' '--with-config-file-path=/opt/lampp/etc' '--with-mysql=mysqlnd' '--enable-inline-optimization' '--disable-debug' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dbase' '--enable-discard-path' '--enable-exif' '--enable-filepro' '--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf' '--enable-gd-native-ttf' '--with-ttf' '--enable-magic-quotes' '--enable-memory-limit' '--enable-shmop' '--disable-sigchild' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-yp' '--with-ftp' '--with-gdbm=/opt/lampp' '--with-jpeg-dir=/opt/lampp' '--with-png-dir=/opt/lampp' '--with-freetype-dir=/opt/lampp' '--without-xpm' '--with-zlib=yes' '--with-zlib-dir=/opt/lampp' '--with-openssl=/opt/lampp' '--with-expat-dir=/opt/lampp' '--enable-xslt=/opt/lampp' '--with-xsl=/opt/lampp' '--with-dom=/opt/lampp' '--with-ldap=/opt/lampp' '--with-ncurses=/opt/lampp' '--with-gd' '--with-imap-dir=/opt/lampp' '--with-imap-ssl' '--with-imap=/opt/lampp' '--with-gettext=/opt/lampp' '--with-mssql=/opt/lampp' '--with-sybase-ct=/opt/lampp' '--with-interbase=shared,/opt/interbase' '--with-mysql-sock=/opt/lampp/var/mysql/mysql.sock' '--with-oci8=shared,instantclient,/opt/lampp/lib/instantclient' '--with-mcrypt=/opt/lampp' '--with-mhash=/opt/lampp' '--enable-sockets' '--enable-mbstring=all' '--with-curl=/opt/lampp' '--enable-mbregex' '--enable-zend-multibyte' '--enable-exif' '--with-bz2=/opt/lampp' '--with-sqlite=shared,/opt/lampp' '--with-sqlite3=/opt/lampp' '--with-libxml-dir=/opt/lampp' '--enable-soap' '--enable-pcntl' '--with-mysqli=mysqlnd' '--with-mime-magic' '--with-pgsql=shared,/opt/lampp/postgresql' '--with-iconv' '--enable-dio' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql' '--with-pdo-sqlite' '--enable-intl' '--with-icu-dir=/opt/lampp' '--enable-fileinfo' '--enable-phar'

Step 4 / Backup

Time to make a backup of the current installation, in case that anything went wrong

sudo cp -r /opt/lampp /opt/lampp.bak

Step 5 / Configuration

Now that we have configuration options , we're going to review it and then use it to compile the new version.
path to with-openssl=/usr or --with-bz2

cd /usr/src/php-5.2/
'./configure'  '--prefix=/opt/lampp' '--with-apxs2=/opt/lampp/bin/apxs' '--with-config-file-path=/opt/lampp/etc' '--with-mysql=mysqlnd' '--enable-inline-optimization' '--disable-debug' '--enable-bcmath' '--enable-calendar' '--enable-ctype' '--enable-dbase' '--enable-discard-path' '--enable-exif' '--enable-filepro' '--enable-force-cgi-redirect' '--enable-ftp' '--enable-gd-imgstrttf' '--enable-gd-native-ttf' '--with-ttf' '--enable-magic-quotes' '--enable-memory-limit' '--enable-shmop' '--disable-sigchild' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-wddx' '--enable-yp' '--with-ftp' '--with-gdbm=/opt/lampp' '--with-jpeg-dir=/opt/lampp' '--with-png-dir=/opt/lampp' '--with-freetype-dir=/opt/lampp' '--without-xpm' '--with-zlib=yes' '--with-zlib-dir=/opt/lampp' '--with-openssl=/opt/lampp' '--with-expat-dir=/opt/lampp' '--enable-xslt=/opt/lampp' '--with-xsl=/opt/lampp' '--with-dom=/opt/lampp' '--with-ldap=/opt/lampp' '--with-ncurses=/opt/lampp' '--with-gd' '--with-imap-dir=/opt/lampp' '--with-imap-ssl' '--with-imap=/opt/lampp' '--with-gettext=/opt/lampp' '--with-mssql=/opt/lampp' '--with-sybase-ct=/opt/lampp' '--with-interbase=shared,/opt/interbase' '--with-mysql-sock=/opt/lampp/var/mysql/mysql.sock' '--with-oci8=shared,instantclient,/opt/lampp/lib/instantclient' '--with-mcrypt=/opt/lampp' '--with-mhash=/opt/lampp' '--enable-sockets' '--enable-mbstring=all' '--with-curl=/opt/lampp' '--enable-mbregex' '--enable-zend-multibyte' '--enable-exif' '--with-bz2=/opt/lampp' '--with-sqlite=shared,/opt/lampp' '--with-sqlite3=/opt/lampp' '--with-libxml-dir=/opt/lampp' '--enable-soap' '--enable-pcntl' '--with-mysqli=mysqlnd' '--with-mime-magic' '--with-pgsql=shared,/opt/lampp/postgresql' '--with-iconv' '--enable-dio' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql' '--with-pdo-sqlite' '--enable-intl' '--with-icu-dir=/opt/lampp' '--enable-fileinfo' '--enable-phar' 

Feel free to leave comments if you had any problem

Your rating: None Average: 3.2 (11 votes)