Install Apache + MySQL + PHP with one command on Linux with XAMPP

Tags: 

Amateur web developers always have problem with installation of Apache + MySQL + PHP to test their code including many administrators that want to install LAMPP Server (LAMPP stands for Linux + Apache + MySQL + PHP + Perl) for doing simple web server (with less security without strict configuration). So there are software that include all LAMPP with only one installation. XAMPP is the most popular one.

XAMPP is all-in-one LAMPP software that avaliable in Windows, Linux, Mac and Solaris (Beta version). Strong point of XAMPP is always using latest version of LAMPP (that can be disadvantage too), ready for popular modules and extensions for Apache and PHP without additional installation, has portable version and using only one directory installation.

I suggest you install XAMPP 1.7.1 instead of latest version because XAMPP 1.7.2+ is come with PHP 5.3 that is not fully compatible with most popular CMS in this time and have many changing critical point of coding. You can download XAMPP 1.7.1 from here.

To install XAMPP on Linux, you must download it first for sure. Next, be sure that you not starting your old Apache or MySQL services (if have). Open your Terminal then login with root user permission, go to downloaded directory then put command.

tar xvfz xampp-linux-1.7.2.tar.gz -C /opt

If you are not using Linux that have root access such as Ubuntu, put this command

sudo tar xvfz xampp-linux-1.7.2.tar.gz -C /opt

(You can read more about tar command at article Pocket howtos: tar command

So you have done XAMPP installation at /opt/lampp

But XAMPP is not running yet. You have to start with command

/opt/lampp/lampp start

Or on Ubuntu you have to use this command

sudo /opt/lampp/lampp start

Last, you can test by opening your browser, then go to http://localhost. So you will see XAMPP welcome page.

You can start making your website by creating .html or .php files at /opt/lampp/htdocs instantly!