How to Setup your Apache / MySQL / PHP Development Environment


» Follow me on Twitter

This page is meant for beginners who wish to start learning how to program in PHP and MySQL as well as for anybody who wants to know how to quickly and easily setup an Apache / MySQL / PHP Development Environment.

So how does one do this? First you need to know what operating system you are using. In this world of PHP programmers, the two major operating systems of choice are Windows and Linux. I bet you know what operating system are you using. If you don’t know how to find out what your operating system is then you shouldn’t be programming. Hehehe just kidding.

So Choose your OS - Windows or Linux

Installing on Windows

Ok. I’m a Linux user but let’s start off with Windows. In Windows, installing an A.M.P. (Apache / MySQL / PHP) development environment is pretty straightforward. You simply download your WAMP installer (WAMP is Windows + AMP) from any of the following sites:

I listed only two but there are actually a bunch more WAMP installers out there. If you want to find them, just do a google search because if you’re serious about programming then you need to know how to use google to answer your questions otherwise you will be annoying a bunch of programmers with your questions. Of the two installers listed above, I’ve only used phpdev5 from firepages and that is what I would recommend because I’ve used it and haven’t had any problems with it. However, XAMPP seems to be a more impressive setup. So pick your choice.
After you have downloaded the installers, it’s just a matter of running the installer’s .exe file an everything is pretty much straightforward.

If you want to read on how to install the same thing on Linux then continue. Otherwise, click here to jump to the conclusion

Installing on Linux

Now, onto the better stuff. Since I’m assuming that you’re a newbie, I won’t be teaching you how to compile Apache, MySQL, and PHP on Linux. Rather, we’d go through the much easier way. Furthermore, since you’re on Linux, I would assume that you know the basics of the Linux command line. Otherwise, learn your Linux skills first before starting to program in Linux. OK? There are lots of Linux tutorials and forums out there that will help you hone your Linux skills. Just google around.

Linux comes in different flavors which are also called distros. All these distros have some method of installing stuff from the internet. But to make it simpler, we will use apt. Though apt is known to be a Debian thing, other distros such as Redhat and Slackware have already incorporated the apt method of installing things into them. So if you’re not using Debian, then just check your distros documentation (or google around) to find out how to install apt on your system. Note for Gentoo users, I understand that Gentoo uses ‘emerge’ to install things but since I haven’t used Gentoo yet, I can’t tell you how. But I believe it will be pretty much straightforward like apt.

So onto apt.

Log on to a console. Then type ’su’ and enter your root password. Then do the following

# apt-get update

After the update, do this to install apache, mysql, and php and setup your LAMP (Linux, Apache, MySQL, PHP) environment.

# apt-get install apache mysql-server mysql-client php4 libapache-mod-php4

Wait for the download to complete. It might ask you a few questions during the process so just answer them to the best of your knowledge. :D.

There you go. If all went well then you have successfully installed or Linux-Apache-MySQL-PHP (LAMP) environment.

Wrapping things up

Now, all you have to do is test it. Try opening a browser and go to http://localhost. If it doesn’t work. Try posting a comment below and I’ll try to answer. :D Or you can try to figure things out. After all, programming is 90% figuring things out. Hehe.

Official Apache, MySQL, and PHP websites


» Follow me on Twitter


April 24, 2006 · Posted in Technology  
    

Comments

Leave a Reply

Start a Franchising Business in the Philippines