Previously i wrote a how to guide on installing Apache HTTPD 1.3 on Windows machine. But it seems that some people prefer to use the new Apache 2.2 series instead of the old httpd 1.3 series which is not good when used on production system (read: if you allow anyone to access your webserver), beside the apache website itself tell you this :
the older 1.3 series was never designed to run on Windows, but that support was ‘hacked in’, introducing a large number of potential thread saftey issues and other confirmed problems.
And that’s why i choose to create the apache guide again but this time it is using the 2.2 series, and of course this guide tell you on how to setup your apache server with php 5 manually not using an all in one package. And here’s the guide :
Requirements :
1. Apache 2.2.x : At the time i wrote this guide, the latest stable version is 2.2.26 (btw get the non-ssl version unless you plan on using ssl)
2. PHP 5.2.x : 5.2.4 is the latest stable version when i wrote this (get the zip version, not the installer)
And here are the steps :
Note : in this example i’m using the default installation path for Apache 2.2
1. Install Apache 2.2 until below screen appears and use this information (or adjust it to your liking) and then continue the process until finished :)

2. To make sure Apache is working now you need to open your browser window and type http://localhost as the address, and if you get the same message like below image that mean apache is working

3. Thanks God the Apache seems to work … but now you’ll need to configure apache so it’ll recognize the php files and can parse the php files correctly. And the first thing you should do is extracting the PHP zip archive somewhere, and in this example i extracted the php 5.2.4 files into C:\PHP-5
4. After finished with the extraction process, now you just need to go to your Apache installation path, and then open httpd.conf which is located under the conf directory using your favorite text editor. Btw if you installed apache using the default path, here’s what the apache directory structure looks like

5. In order for apache to parse the php files correctly, first you need to Load the PHP5 module into the Apache, and to do this you just need to add below line to your Apache httpd.conf (after the last line of the loadmodule section) :
LoadModule php5_module “c:/php-5/php5apache2_2.dll”
Note : Adjust the php path accordingly if you extracted it into other directory
And here’s the image :

5.1 Now you need to search for (use your text editor built-in search function) :
<IfModule mime_module>
and then add these lines inside that directive (before the closing </IfModule> for mime_module )
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
6. After finished with the above process, now you’ll need to configure apache so it’ll check the existence of index.php by default too instead of just checking the index.html only for the default index filename, and here’s how to do it
The default configuration from Apache 2.2 :
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
The modified version :
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
Notice the difference ? i’m pretty sure you’ll notice it right away … but like everyone knew that a picture worth a thousand words (read: because my English language is bad), so here goes the picture

7. Now we are done with the httpd section, now we need to configure php. Here are how to do that :
7.1 Copy php.ini-recommended from your php5 directory into C:\Windows (or your windows path) and then rename it into php.ini
7.2 Open the php.ini file using notepad and change the extension_dir as shown on below image :

7.3 Now you need to copy some dlls from your php 5 directory into C:\Windows\System32 :

Im pretty sure that you can’t read the filename from the above image, but don’t worry because all you have to do is just :
Right click and choose Arrange Icons by name, and then copy each file shown on the above image into your windows system32 directory, and you’re done (hint: hold CTRL key to select multiple files)
Or … copy all dll files at the root of your php directory into your system32 directory except those that is using php5*.dll
8. Now we’ve configured php, apache … but what else do we need ? of course we need to make sure that php really working and apache can parse it without problem, so we need to create a php test page first, here’s how to do it :
8.1 Create a file named test.php inside C:\Program Files\Apache Software Foundation\Apache2.2\htdocs (because that’s where the default document root path of your apache)
8.2 Add below line to the test.php file like shown on below image, then save and close the notepad

9. Okay … finally we’ve reached the final stage !!! now you just need to open command prompt and type like below image :

If you can’t read what you should type from the above image, actually you just need to type :
net stop apache2.2 && net start apache2.2
to restart your apache 2.2 process
10. Now after finished restarting the apache process, we need to open the browser window and point to http://localhost/test.php

If you see something shown like on the above image, that means Apache and PHP is working on your system
Congrats … now you’ve got apache and php 5 working on your system the only thing left is … adding mysql support (if you plan on using a registration page for your Mangos Server or other private server), and to do this you just need to remove the ; from the extensions, for more information, you can download the sample php.ini and httpd.conf as a supplement for this short how to guide
Hint : Compare the sample php.ini file you’ve downloaded with the default php.ini file from the php.ini files included in PHP archive (in this case you can find it on your windows directory)
Hopefully i didn’t miss anything, but if you do notice that i miss something, please let me know so i can fix it or add it :)
Thanks to Al for the suggestion :)
Leave a response
Thanks, I went to that site, loaded it in and it works great, I think my machine creates text files instead of PHP’s, not sure, maybe I’m supposed to have some software to make a PHP?
everything works fine at the moment so i may jst keep using abyss webserver as that is functioning. the problem im having is i downloaded php 5.25 where u had 2.24 and once installed there is no ext directory and also there is no extension_dir. any ideas?
I had a similar problem. I had to change the drive letter from c(lowercase) to C(uppercase). May be that was the difference between your copy of the config file and the one you had downloaded.
I must have forgot to say please. :p
Jeremy, You can grab one from http://rospora.powerlogy.net (it’s a premade registration page)
Hello, so I downloaded your sample files and it’s showing the it works screen if I type in localhost, but.
If I type in the test.php it does not, so…
May I ask, can I get your sample registration page, so that I can test that? I cannot find it anywhere on your site/forums, please e-mail one to me.
jeremy7780@gmail.com
Thanks, and hey, great jop on this and that new patch for mangos, I love it all!
Yeah, so I did everything and unfortunatly, there is nothing at the end of this tutorial that states what to check IF you don’t get a succesful launch.
Any suggestions? I can’t start the service now that I’ve stopped it, and it isn’t doing as it’s supposed to. = (
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Jeremy>net start apache2.2
The Apache2.2 service is starting.
The Apache2.2 service could not be started.
A service specific error occurred: 1.
More help is available by typing NET HELPMSG 3547.
C:\Documents and Settings\Jeremy>
In step 7.3, when you copy some dlls from your php 5 directory into C:\Windows\System32, you say to copy all dll files at the root of your php directory into your system32 directory except those that is using php5*.dll. However, your image doesn’t show ntwdblib.dll (SQL Server Client Library) highlighted.
Should that file be copied as well?
Thanks!
Nm about the batlemaster thing I know now how to make it work for 255 lvl cap. Thanks for all your help.
Reaper-X thanks works good :)
Are you going to make on update with GM island for the new wow patch? And mayb make battlemaster work at 255 lvl cap :) it be nice.
hey, GREAT ARTICLE. been looking for this for a while. for the record.
REGARDING STEP 7.3, if you don’t want to put a bunch of crap into your windows folder,
JUST ADD YOUR PHP DIRECTORY TO YOUR PATH:
1.right click My Computer
2. Properties
3. Advanced
4. Environment Variables
5. Find ‘Path’ in System Variables
6. Edit
7. Append the below line to the variable value:
;c:\php-5\
Change that directory to reflect wherever you put PHP.
# KK
Could you post the error message here ? (look at the error log file in your apache directory)
# Alex
Thank you Alex, as for premade reg page, previously i’ve tested this and it works fine :)
http://rospora.powerlogy.net
Reaper X thanks for the how to, very easy to fallow and your fallow ups on posts are great. But one thing I didn’t get where did ppl get the registration template that works and is there a (how to), too links the template with the data base? I know html and I know how to edit php, but I need some info on where to start as this how to only shows how to set up a web server. Thanks all for your help.
Ok i followed the whole guide and I am using RoSpora , I have set up everything but only a blank page loads, i tried the modified .ini u posted at the end and its still a blank page, i eve tried taking out all the ; at the extension part and re copying and pasting the dll’s but its still a blank page. Can anyone help me out?
Thank You
Can you give ma the notepade of this ,,httpd.conf” cuz i dont understand this part :
5.1 Now you need to search for (use your text editor built-in search function) :
and then add these lines inside that directive (before the closing for mime_module )
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
please give me an notepad of all edited notepad , please.
Found it and it works now ;P
where is the file to download i dont see it?
Hey, I followed the tutorial up to:
net stop apache2.2 && net start apache2.2
When I try to run it I get and error that says:
“a service sepcific error has occured: 1
more help is available by typing net helpmsg 3547.”
I checked everything over twice there is no errors as far as I could see. I did everything exactly as you did also. Where can I download the sample file?
I have followed the directions (and they are done very well) but I am not able to get the registration page to work…keeps telling me it is not connected to the data base….I used all default settings and I am not to confident around SQL I have a working game server and have web server running according to all your directions..but I seem to have gotten lost when it cam to connecting the registration page to the data base…How is this done? and are there any working links to registration page (blizz like) that work…I have tried (http://www.themangosresource.com/mangos-web-management/) but you need to register to get access and I registerd 2 different times and have yet to get a confirmation email…
any help ?? I am lost…and I would like to get this working.
hello reaper-x, my question is, if i have a website how do i create a page in it for registration to my wow server?
at like step 9 when i went to start apache again it kept giving error:”1″ lol
but i found out why i forgot to add a space in the loadmodule step between “LoadModule php5_module” and ““c:/php-5/php5apache2_2.dll”
xP
if anyone else get’s that error when starting appache that’s probably why (i was flipping out, cause i followed the guide to a T and didnt get any results)
eeeesy peeasy
Hello JMT420,
Most easy to eay to save .php is Just go My computer then click on tool button and then press folder option button, click on view tab and then uncheck for hide extension for known file types and click on apply button.
After that you can able to create easyly .php files.
After your task is complete(.php page creation) check hide extension for known files type.This is the best steps fer beginners.
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com
Has anyone come up with a solution to the part where you test the file test.php because a lot of people including me cant get passed that last part.
EDIT NVM when you make the test.php file make sure you save as test.php and MAKE SURE you save as type all files.
First of all thanks for the guides. Everything is working perfect.This is the first time i encounter a problem. everything is set up correctly. but when i start the apache server i get this error:Make_sock:could not bind to address 0.0.0.0:8080 no listening sockets available, shutting down.
Note:i changed the port to 8080 because an application is using port 80 but i can’t find it in task manager to turn it off.
when i use a dns (alldaypvp.getmyip.com) i can log on to the server at my house but my friends cant log on to it from there house.. do you know what the problum might be?
i used a premade registration called spora but it seems like the php to mysql wasnt right
yeah same to me :(
and how can I put my site online cause now it’s just localhost… :s
yeah i need one 2.. all the ones i’v found dont work right
can you give a link to a premade file or soemthing cause I can’t find anything.
whats the mangos forum?
actually you can use any premade registration page available on mangos forum as long as it’s made to work with the new mangos encryption :)
do you know of any premade registration temlates that work for your mangos
You can just add the php root directory to your system path enviroment variable and you dont need to copy the php5*.dll files to your system32 directory. At least this worked in Vista Ultimate.
mm it looks liek a previous comment hasn’t been submitted but it doesn’t matter it works now :p but now I need to find out what i have to edit to make the auto-acc-create page :p
any help is welcome :D
nevermind it works. it was a *.txt and it had to be a *.php file the name was correct but when I used textpad to look at it I saw it was test.php.txt so I changed it to test.php :D
but um what do I have to do now? to make a auto-account-create page for my wow pv server?
Hi Rappe,
I donot really understand what you are try to say.
Make sure that, you are use ing non smart quatos in file.
compare your httpd.conf with reaper-x httpd.conf file.
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com
And what shoudl I look at then at the http.conf file? cause I just added and editted the things reaper said :s
Hi Rappe,
If you are faceing problem to reasrt apache from command line.You can restart from apache program.
If you are faild to restart apache anyway, Then first check your httpd.conf file and check your installtion.
most time its accured for misconfigration of httpd.conf file.
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com
Sorry,
this line is not appear on post.
IfModule mime_modul
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com
Hi tom,
5.1 step is very easy, Just search with your text editor for and then put lines that is given by 5.1 step. Most text editor is inbuilt with search funtion.In notepad you can find it on Edit menu.
if you have problem to edit httpd.conf. Then just download it from this website.
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com
Could you put a picture for step 5.1 i can’t relli figure out wot your trying to tell me to do, a picture of the step would help nicely thanks.
So I get this:
net is not recognised as an internal or external task, programme or batchfile.
When I type:
net stop apache2.2 && net start apache2.2
in cmd :s
srry for double post translated something wrong :p
So I get this:
net is not recognised as an internal or external task, programme or batchbestand.
When I type:
net stop apache2.2 && net start apache2.2
in cmd :s
when i try to restart apache via cmb it can’t find it it, but if i try to restart via the program itself it says the requested operation has failed :s
Ok, did you send it to him?
Hi,
Thanks for your comments. But in my guide, i was successfully edit spellings, And my guides are based on images, so donot worry about speeling and english.
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com
I’m sure you can just ask him through his e-mail.
As far as for your posts, it looks like the tutorial may have to get spellchecked and grammaticly cleaned first.
Your english is not the best I have seen q:
Hello repper,
I was created a guide to install Apache and php in win operating systems.And i mentened every steps for new users for quick and hassle free installtion. Can you host my guide in your website?.
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com
Hi,
Many times genral quatos convert to smart quatos in some furum and some pdf documents. In some text edittors.Both of them seems same. But when you try to run your php document, its canot run. Some time, you are not able to run your script then, first check your quatos.
Thanks,
Vishal
vishalgaurav01@gmail.com
linuxvishal@yahoo.com