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.
December 29th, 2009 at 10:38 pm
I suppose I’m gonna have to read up some more but this is a really good spring board.
January 9th, 2010 at 4:12 am
Awesome remark about google. I’m frankly incredibly flabbergasted that it hasn’t been enunciated earlier to such great lengths.
January 19th, 2010 at 5:01 pm
Hi Guys ! Let see this, i found it minuts ago, it’s totally crazy, an online free flash web editor that permits you to create a website for free with no programming skills ! create a free flash website
January 21st, 2010 at 3:21 am
having a useful information. Thanks a lot!
January 21st, 2010 at 6:00 pm
Great writing. I appreciate you for posting it. Keep up the fine work.
January 25th, 2010 at 1:29 pm
Protect your assets with WiredTree.com Server Shield, free to all clients.
January 26th, 2010 at 9:47 pm
No comments, let see this video, it talks by itself create a free flash website
January 28th, 2010 at 2:18 am
Best wishes!Your blog is very good!
February 4th, 2010 at 9:02 pm
It is so nice.
February 8th, 2010 at 8:56 pm
Wooooooow let see this friends designers, a free online flash web builder requiring nor programming skills at all ! how to create a website or blog
February 14th, 2010 at 9:28 pm
Sweet, finally a post that fulfills my research. So many people get this topic wrong. You are a great thinker.
February 18th, 2010 at 8:06 pm
I
February 19th, 2010 at 5:08 am
the best idea is 100% content. Use content when you do your promotions. You
February 21st, 2010 at 3:52 am
Very creative, one of the nicer sites I have seen today. Keep up the great work.
February 21st, 2010 at 12:04 pm
I found this great SEO assistance today and thought i will reveal it over here
February 21st, 2010 at 8:31 pm
If yu are looking for a very comprehencive SEO analysis of your website then you want to check out this incredible offer here http://www.bh-server.com/seo
February 22nd, 2010 at 3:48 pm
Hey guys, I heard that a company that helps you to create any of your programming ideas for peanuts ! programming outsourcing . As I heard, this company will help peoples getting top quality programmers for real affordable prices making everyone able to launch his IT startup !! So nice !
February 25th, 2010 at 10:51 pm
i wouldn’t have believed this was trendy a number years ago nevertheless its interesting the way age adjusts the means by which you experience a variety of creative ideas, many thanks regarding the write-up it’s nice to look over anything intelligent once in a while instead of the regular nonsense mascarading as a blog on the web, cheers
February 27th, 2010 at 10:04 am
Hey web entrepreneurs ! You have great ideas and are looking for the best value coding company and/or looking for investors to help you fund your project? Just enter this place, I found it days ago, it seems to be in alpha but the concept seems really good ! CODINGATE .
February 28th, 2010 at 4:06 am
Proficient blog! I’ll probably be citing some of this info in my next assignment.
March 5th, 2010 at 10:13 am
A good tester will have a systematic approach to testing that they can hold to any recognized scenario without reluctance. The one I got many another moons previous was to document the runs for pulling out a can from a lemonade vending machine. I did the total requirements, probed the testing environment, checked the machine was fit for testing and commenced the “tests”. Put in too little money, make money repaid, put in correct money, have money given back etc. Then when I did finally press vend, the can got stuck instead of falling to the tray. So I implemented the “workaround” of shaking the machine with my shoulder. My report concluded that the machine was periodically unfit for use unless a physio could also be installed in the building to deal with the multiple sore shoulders that would result from its implementation.
March 13th, 2010 at 5:04 am
Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don
March 13th, 2010 at 11:20 am
Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don