Beginner - How to install PHP

Hello, first off my name is David and I am tasked with building a intranet website for our company. We have some fairly grand plans for it eventually but for right now we just want it to “host” (be the interface for) a asset tracking database. I am going through a article on the MySQL website called “Building a Database-Driven Web Site Using PHP and MySQL” which so far is great but I am having trouble installing PHP. I went to the website and downloaded the most recent version and downloaded the binary zip (I think) and unzipped it on the server (I have a test server that I am playing on so if I break it I just rebuild and the rest of the company never notices) but the files that I unzipped have no installer file or anything so I am confused as to what to do from here. Did I download the wrong thing? The article points to another article that guides through installing PHP the link is no good. Any help here would be much appreciated.

We need to know what type of OS you are installing on

Also, I am running a server with Windows 2008 server standard R2 with IIS and MySQL 5.1.68-win32

Do you plan to use Apache or IIS? Does it matter to you which one you use? (I noticed you put with IIS, but was uncertain if that is a requirement)

I honestly don’t know which, this is all new to me. Please be patient with me, I am learning this all as I go. Which would be the better option? (I know that is probably a completely opinion based question but you are the guys I have to ask right now so whats your opinion)

Well, I usually recommend apache when dealing with PHP or nginx. For apache, here are a few tutorials

For nginx (if you have never heard of this before, you should probably go with apache)

Also keep in mind, that there are some functions (ones you probably won’t need as a beginner) that will not work on Windows, as the main platform for PHP is linux. A couple things would include SHMOP (shared memory), PCNTL_FORK (process forking). But running a production PHP deployment on Windows is definitely not out the question.

Do you mean that there are some functions of PHP that will not work on windows or apache? I am trying to keep the future in mind when I get this started, I want to be able to do everything we want with it eventually without having to change basically everything, as well as not making it hard for someone who might come in after me. (course I guess that would depend on what they know and how good they are at one or the other.) My network is about 50 machines, most in house at the main office, with the others connecting through VPN. I don’t really expect the network to grow to much larger in the near future (we are a agricultural coop so when we add a location it is a grain elevator with 2 computers) but I still want to have lots of options with this. Of course there is the fact that I have no idea what those things are (SHMOP and PCNTL_FORK) but I am trying to think of the long term. I just really don’t want to jump into this and end up shutting down possibilities of what we could have done.

Ok another question, (this probably screams that I am in over my head and basically that is true but help me out here I am trying to learn to swim). What is Apache(or IIS)\what does it do? Not really looking for a ten page technical answer but just a basic function.

Yes, there will be a few components in PHP that won’t be usable running on a Windows environment. Similarly, I believe there are a few Windows components in PHP that won’t work on Linux. Don’t really worry about that, as you can work around 99% of them using different techniques.

Apache and IIS are your web servers. They receive the request for a page and direct it to the code/file located on your server and execute it, if necessary, and then serve it up to the browser.

Ok that answers the first question great and confirms my basic ideas on the second. If I may ask, why do you prefer Apache over IIS? I can’t say I have a preference because I have never used either of them.

IIS/Windows is a lot more expensive (costs run in the hundreds of dollars) to license than Linux/Apache, for no apparent gain as far as I can see.

That’s the tangible cost in just purchasing the license/seats for the servers. Both have Administration costs and if you are unfamiliar with Linux, that cost could be greater than maintaining a Windows system that you are already familiar with.

@Hispaladin ; I usually prefer using Linux with Apache, but I’ve run PHP on both Windows using IIS and Windows using Apache. It comes down to what was requested and what everyone was familiar with. If you aren’t familiar with any of it, then think about how your company is organized and who would eventually be in your place in the future. Would the company primarily endorse a Windows architecture or are they open to Linux? Go with what you think the company would want to have and maintain future going (which may be Windows with IIS).

@cpradio Thanks for that input. I will have to do some thinking on that. I really am not sure at this moment because I am the first dedicated IT person the company has had (frightening I know) and at this moment I think they are just starting to realize that if I leave they will actually need to replace me. So far they don’t seem to be against Linux but I am not sure of how far that would go. Does Apache require licenses for its use? (they do like cheep when it doesn’t cost quality). Thanks again for all the info and help on this.

Linux and Apache can both be obtained free (for Commercial and Personal use), however, I HIGHLY recommend that if they go this route to get you training in managing Apache/<whatever OS you end up using> – it will be worth the cost in the long run. You can find out more about Apache’s License at

For Linux, there are both Commercial abilities (so you get Support), and complete you install it and you support it (thus free) options. Support can be a BIG deal for companies, that’s one reason Microsoft excels, but there are a number of good Linux vendors who do equally well in this area. Red Hat, Ubuntu are the two big names I know of (I’m sure there are others). Fedora, CentOS, and Debian (my personal choice) are all free (but there is a huge learning curve to Linux, so be warned).

I should also mention there is a TON of free support forums out there around the Linux/Apache community, so if you get stuck, you usually just have to search for a forum and post a question. You might not get an answer immediately (whereas, paid support, you might), but you’ll get one eventually.

After doing some digging on the whole licensing issue I am leaning toward Apache as this project will not be a kingpin for the company (pull it out and the company falls apart). And I am fairly sure they are not going to want to spring for a bunch of licensing for a product they are not sure they even need (I hope to convince them that it will be well worth the time and effort/money once they see it working). I will look into training for Apache/Windows 2008 as that is what we are using on all our servers currently and I don’t see any desire to change.

One thing to mention, you don’t need a license for IIS if you have Windows Server 2008 (IIS is included), the only licensing in question is Windows versus Linux. With you already having a Windows 2008 box, Apache versus IIS is purely a choice. IIS you will likely get support under whatever contract you may have with Microsoft (any Technet Subscriptions, etc). Apache, you’ll primarily stick to online communities and any training.

I personally feel PHP runs better on Apache than IIS, but that is my personal opinion. If you company is okay with that approach, I’d choose it (bonus, if they’ll get you training on it).

You’re also going to find a lot more documentation and people willing to help you with issues you may run into on Apache rather than IIS

OK so I am installing apache and I have a question before I go any further. I am at the option to install “for all users, on port 80, as a service.” or “only for the Current User, on Port 8080, when started Manually.”
the instructions say if you have a WWW server already in use to use the second option. We have a server that hosts a webpage but it is not a www website. it is, will that get in the way (or rather will this get in the way of that?) This server will be hosting an intranet website that would be more like, not sure if that would make any difference or not I just can not do anything that will get in the way of our citrix page.

You should be fine using option 1. So long as the DNS entry for goes to the new server, you’ll be just fine.