Learn PHP - Part 1: Setting up your AMP
January 20, 2008 | PHP, Web Design |

Photo: Ian Broyles
Welcome to Part I of Learning PHP. If you’ve come here directly, be sure to check out Learn PHP - Introduction for an overview of the entire series!
PHP lives on the server-side of town
Every programming language has many unique qualities, but they all share one common step - they need to be processed. Processing, or parsing in the case of PHP, takes the raw lines of code and converts it into useful data.
PHP is a server-side language. What does that mean? It means the server is the one responsible for processing the PHP code. In other words, when you write in PHP, the web server reads the code, parses it, and sends the result to the web browser. The web browser takes the information and displays it for everyone to read. You can see this process in the simple chart I made:

Icons: Deleket
Different languages have different processors. For example, in Windows the code is processed ahead of time, instead of on the fly. In this case, it’s called compiling. The compiled code can take a lot of different forms and file types, but most commonly is seen as a .exe file.
HTML, CSS and Javascript are also processed, in this case by the web browser. If you’ve ever wondered why the same webpage will look different in IE than in Firefox, look no further than the processor each browser uses. Since the client’s browser is the one doing the processing, these languages are referred to as client-side languages.
PHP on a (virtual) server
As you can probably guess by now, without a server to parse PHP the raw code is worthless. The good news is 99% of web hosting companies will have a PHP Parser installed by default (or have it readily available to install). This is great for when you’ve completed your PHP project, but it isn’t practical to write/test PHP code by uploading it to a server, especially when you’re learning the ropes.
The practical place to develop PHP pages is on your own computer (duh). But there’s one small hurdle to overcome: your computer isn’t a server, and can’t parse PHP by default. In order to learn PHP, you’ll have to install a server package on your computer. Otherwise, this will happen:

Icons: Deleket
If you’re scared about the idea of installing a virtual server, don’t be. With most packages, installing a virtual server is just like installing any another program. A few clicks, and you’re ready to rock.
Even better, it won’t take up a lot of system resources. In case you’re hesitant to believe me: looking at my system processes, my virtual server is taking up 23m of memory. Pidgin, my instant messaging client, by comparison takes up a little more memory, at 24m.
A Lamp? What’s a LAMP?
Before you install your own virtual server, let’s first take a second to understand what it’s emulating. If you took a poll of web servers on the internet, most of them would be running a AMP software package (the acronym AMP simply stands for Apache, MySQL, and PHP), either on a Linux (LAMP) or Windows (WAMP) server.
It’s important to note that there’s a number of alternatives out there to a AMP setup, e.g. some people swear by Lighttpd instead of Apache. But unless you already know your way around another software package, stick with a AMP. There’s a reason why it’s so common, it works.
There are AMP packages for every operating system, and Wikipedia has a great page listing a lot of the options. If you’re running Windows or OSx, I’d recommend going to xampp.org and downloading their full package.
Why Xampp? First and foremost, it’s the one I use. It installed in just a few clicks, runs seamlessly, and I’ve never had a problem with it in Windows and OSx. Not to mention the fact that it has both PHP4 and PHP5 installed, which could come in handy down the road (more on that later).

Icons: Deleket
Once you’ve got your AMP up and running, you’re ready to parse PHP. Congratulations, PHP is at your fingertips.
Head on over to Learn PHP - Part 2: Zend 101, to get started coding!
If you liked this entry, click here to subscribe via RSS
-
Subscribe via RSS
-
-
Recently Written
- Site News - Updates! Redesigns! Oh my!
- Learn PHP - Part 4: Taking Part in the Community
- What Lists Can Teach Us about Web Design and Blogging
- 6 Things Webdesigners Should Check Before a Site Goes Live
- Learn PHP - Part 3: Expanding Your Resources
- Freelance Web Design - Writing A Client Reference Manual
- Search Engine Optimization - Part 1: The Basics
- Self Management - Staying Focused with Free Music Online
- Small Business - To use an I or a We?
- Site News - New Site: Rhino
-
Most Popular
-
Categories
-
Daily Reading
Design Articles
Design Inspirations
Blogging
Small Business Finance
Self Management
-
Monthly Archives

Stumble It

[…] to Part 2 of Learning PHP. If you’ve come here directly, be sure to check out Learn PHP - Introduction for an overview of the entire […]
[…] to Introduction to the Learning PHP series. Part 1 and Part 2 are complete. Be sure to check in for the rest of the series, coming very […]