PHP 101: Installing Apache with XAMPP for PHP
May 15th, 2007 by Justin CarmonyHow to get started
So you want to be a web developer? Professional or as a hobby, PHP can be a fun experience. However, if you don't know where to start off, it can be a total pain in the butt and a huge headache. We hope to help give people a good shove off into PHP programming world. However, we want to avoid technical jargon (words) and keep it easy for gamers to understand.
In this tutorial we will accomplish the following:
- Get a basic understanding of what PHP does.
- Install software (XAMPP) to run a personal web server on your own machine.
- Learn how to make simple script files and where to save them.
- How to view your website.
What is PHP?
PHP stands for PHP: Hypertext Preprocessor. That is the only textbook thing you'll read in this tutorial (or so I hope). PHP is used to create dynamic websites, meaning that websites that can change the content it displays without a person changing it manually.
Websites are made using HTML. If you're looking for a good place to learn HTML, check out W3School's HTML Tutorial. However, there are limitations to HTML. HTML on its own can't access a database to get information, or HTML can't manage different sections on a website. HTML pages on their own are static (for the most part), non-changing.
So lets say you want to make a page that displays a person's name when they log in, and if its their birthday to display a message. You would do this using PHP. We'll explain later on.
Time to install!
Alright, you guys are 10 times luckier now than when I started PHP programming. I had to go out and install and configure Apache (the webserver), PHP (coding language), MySQL (database software), and any other extras I needed, like FTP, email, etc. Then I had to configure it all. If I did one thing out of step or configure incorrectly anything… it would explode and die on me.
However, three years ago I found this amazing program which is the best thing for easy web servers. It makes installing and coding on your computer a few clicks away. I would have killed (almost) to have had this. It is by Apache Friends, and its called XAMPP.

!!!!!!!!!!!WARNING!!!!!!!!!!!
If you use Skype, close it before installing XAMPP. I don't know why, but Skype reserves port 80, which interferes with XAMPP.
Go to Apache Friend's website and go to XAMPP -> XAMPP for Windows -> Installer. Or, if you're lazy, just click here to download it.

After downloading the installer, run it. You'll see the following:

Select your language (I'll select English). Hit okay, you'll see this:

Just click Next. Now it will show your location. I'll be using the default.

After clicking next, you'll see several options:

Now, you can keep the defaults. If you want to install the Services you can. What that means is that in the background of your computer the programs for running a web server will always be on.
Go ahead and click next.

Its going to install the needed stuff. If it install successfully, it will show this:

Click finish.
Now that XAMPP is installed, the web server stuff isn't started on your machine yet. To do that go to Programs -> Apache Friends -> XAMPP -> Control Panel. Or click the link on your desktop. It will open a window like this:

Here is what each of these programs do:
- Apache - The Website Server for your computer. If this is off, you can't view your sample code. This will be needed for this tutorial
- MySql - The Database for your computer. If this is off, you won't be able to have your site access a database. This won't be used in this tutorial, but it will in future tutorials.
- FileZilla - A FTP server. This won't ever be used in one of our tutorials.
- Mercury - a Mail Server - this won't ever be used in one of our tutorials.
Lets start Apache and MySQL. Click the start buttons for each. When they are started it should look like this:

If Apache or MySQL won't run, it means something is using the those ports (they are 80,443, and 3066).
Now your have a web server running on your computer. Congratulations!
Making a PHP script
Now lets make your very first script! First, I would download a program called Notepad2. It’s a very lightweight text editor that highlights text according to what it is. Now create a new document and past the following code in your editor:
-
<?
-
-
echo "Hello World!";
-
-
?>
After you enter that into Notepad2, save it to "C:\Program Files\xampp\htdocs\test.php"
After saving, In notepad 2 it should look something like this:

Viewing your website
Now, go ahead and open FireFox or Internet Explorer and in your address bar type this:
You should see this:

Congratulations! You're ready to start programming in PHP!
That’s the end of our article for today. However, if you're interested in learning more about PHP now, I'll give you some links for good beginner tutorials.
Tutorials
W3Schools HTML Tutorial - http://www.w3schools.com/html/default.asp
W3Schools PHP Tutorial - http://www.w3schools.com/php/default.asp
Zitag PHP Tutorial - http://www.tizag.com/phpT/
Coming Up Next
Next tutorial we'll teach you the very basics of PHP, in many ways the things covered in the tutorials above. Hopefully it will be out by next week.
Questions
Q: Do you seriously use the default background for Windows XP and you use the Classic Theme (aka ugly windows 98 look?)
A: I have two installations of Windows XP on my computer. One for work (programming, web development, etc) and one for gaming. I have over 5 different IDE (Integrated Development Environment, aka Visual Studio, Zend Studio), 4 different databases, 3 types of web servers, and tons of other utilities for programming installed on my work machine, not to mention my virtual servers I use for testing. In short my "work" installation of XP is overloading with crap, and I don't need anything else using more resources. Besides, if you work a lot with Windows Server 2003, you get used to the look.
Q: How long do you think it will take me to learn PHP?
A: Well, depends on what you call "learn". If you have previous experience with programming (like in C++, Java, VB) it will take a few weeks to get the principles down and understand how PHP works. To fully master PHP, never. There is always more to know. PHP is very powerful and neither Eric Ping or I (Justin Carmony) know everything. There are a lot of features we haven't even explored yet.
If you have any questions or comments, please feel free to leave a comment or email us at devzone@cevolved.com.
May 15th, 2007 at 4:50 pm
Testing the comment system.
May 15th, 2007 at 5:23 pm
Second Test, checking color switching rows.
May 16th, 2007 at 7:18 pm
might want to change the footer unless this blog is for web design about traveling seo and concerts?
May 16th, 2007 at 8:28 pm
lol, my fellow spanish speaker, I’ll get right on it ;)
Justin
June 11th, 2007 at 3:17 am
[…] test web server. If you don’t know what I’m talking about, then follow this tutorial on how to install XAMPP on your PC, which will allow you to run php websites right off from your PC. We will be using Notepad2 to do […]
March 4th, 2008 at 6:11 am
i had a hard time running xampp’s apache on windows 2003 server….
June 15th, 2009 at 8:15 pm
Hi, I need the email of “Miguel Espende” please, what can I do?. I’m don’t speak english, I speack spanish. Thanks.