Tuesday, February 17, 2009

Correct Installation Steps for XAMPP 1.7 on Ubuntu Linux

So, for my freelance projects, I have to learn PHP, and use MySQL as database.

I have an Ubuntu 8.10 Linux distribution, and the best tool available for developing web apps with PHP and MySQL is XAMPP (formerly LAMPP: Linux, Apache web server, MySQL database engine, PHP programming language, PERL scripting language)

XAMPP is basically a set of tools well-packed to run altogether. It is called now XAMPP and not LAMPP because it is available to all operating systems, not only Linux.

Usually the best way to install a software in Linux is to get the debian package installation, (.deb file, this is because Ubuntu is built over Debian distribution) but for XAMPP there's nota debian package; there's a self-contained .tar.gz file (like a .zip file for windows users) with a folder called lampp that includes all tools embedded.

There's a comprehensive installation manual on the XAMPP pages for installing and setting it up, however, it doesn't include some minor changes that are required in order for some included XAMPP tools (such as MySQL) to work well.

After installing XAMPP do the following:

1.- For XAMPP web page to run: give proper read/write permissions to 'others' on the lang.tmp file at /opt/lampp/htdocs/xampp folder; go to the folder and execute the following command as root user:

#chmod 666 lang.tmp

2.- For MySQL correct execution: provide read/write/execute permissions over the var folder and all its contents. As I hadn't identified the right user, I assigned it to everyone. Go to the /opt/lampp/ folder and type:

#chmod -R 777 var

I've spent HOURS figuring out in error logs and forums for the right answers. I don't even want to list all of the errors I've faced. This should solve any of your installation problems on Ubuntu 8.10 and basically any Linux distribution.

Greetings!