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
Sorry for all the posts in a row. Just one last question. I have set this up on my computer in order to test pages made prior to uploading them to the internet so as I make pages do I need to put them in the htdocs folder in order to properly view them?
Well how is this for weird. I downloaded your httpd sample file and opened it in Dreamweaver along with mine. I looked at them side by side and they are identical. So just out of curiosity, I took yours and moved it into my apache directory in place of mine and restarted Apache and it worked! Crazy!! Anyway, thank you very much for your tutorial. And your english is good, I wouldn’t worry about that too much :)
I followed your instructions and I also created a folder for php C:\php-5 and put all the files from the zip as instructed. I opened the httpd file for apache and on line 115 after all the LoadModule I added the following LoadModule php5_module “c:/php-5/php5apache2_2.dll” I then got down to the final steps where I needed to restart apache so it would see the new config file and I got the following error. I checked the location of the file and it’s there. Am I missing something?
httpd.exe: Syntax error on line 115 of C:/Program Files/Apache Software Foundation/Apache2.2/conf/httpd.conf: Invalid LoadModule path \x93c:/php-5/php5apache2_2.dll\x94
thanks reaper-x!! you are right, i put them back and i can now access mysql
You can just simply overwrite it or .. backup the old libmysql.dll first and then overwrite it :)
what if it is already there?
actually if you remove the dlls from your sys32 directory, you won’t be able to use the mysql function properly :) (which is needed if you’re going to use the registration page because most of them based on php and mysql)
and if you’re having problem with php can’t use its mysql function, you just need to copy libmysql.dll into your sys32 directory ;)
sorry,i meant system32 and not win32
hi reaper-x,i finally got it to work, i removed all the dlls i had put in win32(which u had suggested to put) then i added the following lines to http.conf:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
does anyone know whether the apache documentation talks about installing php, i cant seem to find anything on it
i am using apache http server 2.2.4 and php5.2.4. i have followed your guide but am still not getting the desired output from test.php, i simply get the code displayed in the browser. please help
Hey mike, I had the same problem, if you search around these forums theres an update to reaperx batch file which works, when you want to change the drop and exp rate.
I have gone into my mangosd.cong and changed the kill rate to 250. That did not work so I changed it to 2. Still no luck there so I tried 2x as a last resort but still had the same affect of no change. Am I doing something wrong?
# James
You’ll need to specify the full path of your php5apache2_2.dll
download the sample php.ini and httpd.conf to see what it should looks like :)
# Mike2
Did you use the load php module ? and don’t forget to restart the apache service after you’ve finished editing the httpd.conf
Hey,
I have followed this guide closely, but it hasn’t worked out for me. At the end when I type in “http://localhost/test.php” I get the message in the back that says “It works!” and File Download window appears, asking if I want to save the file “test.php.” If I click open, the browser closes.
Any idea on how to fix?
is there a way you can email or something, and help me out? Anyone?????? I’m desperate here!
Yeah, I already did that. LoL Pretty quick! I still can’t get past this crazy loadmodule error.
Okay, I finally got it figured out. But it still doesn’t work. I did everything you said to do, and when I try to restart Apache, it says that my LoadModule couldn’t be found. That it needed a name, and a directory to associate the file with. I believe it actually says, “LoadModule takes two arguments, a modulename and the name of a shared object file to load it from.” What the………..??????????????
# James
Ah so sorry about it, to make it easier, just copy any dll at the root of the php directory into your system32 directory except those that has :
php5*.dll
at the filename :)
Well, I did just about everything so far, but I cannot read those files I’m supposed to move into my Sys32 folder!!!! I’ve tried everything from blowing the pic up, but I can’t read it, and I don’t know what files to put where!!! Why didn’t you just type the filenames for us so it’d be easier?!?!?!
I followed all you instructions but when I go to http://localhost/test.php it shows me an error of HTTP 404 PAGE NOT FOUND.
Please tell me what should I do..
I installed PHP and Apache and they are working on my pc.
What do I do now to run my WoW server online???
Sorry for my English.
I have to commend you on an excellent set of guides for setting this up, I have everything running and I’m going to configure the reg page (maybe) :) So far, I’ve had little issue with every guide you made. And I’m using all your latest stuff. Thanks again!
i have done everything up to the part where you create the test.php file and it has worked. once i get to this point tho, i try to go to http://localhost/test.php and it gives me the 404 Not Found with this messege,
The requested URL /test.php was not found on this server.
i dont know what i have done wrong so if you can give some guidence that would be wonderful
So…I turned all windows updates…it didn´t helped me, but then i ran my favourite program:
SYSTEM MECHANIC
IT RULE! It repaired me lots of registry problems, but one not: .msi opening :D:D.
I´ve decided, I will not make my server “public” (anyway I just wanted to try it ;))
then I found apache 2.2.6 .ZIP ! cheers of that ;) Now I have found one great funserver…playing on it.
Maybe later I´ll try to make my server again.:)
THANK YOU VERY MUCH REAPER-X. YOU RULE ;)
& BYE ;)
# Sporky
You need to change the realmlist ip address into your own ip .. that’s it ;)
and oh you need to execute mysql queries in order to do that (the easiest way to do this is using SQLYog if you have it … but if its for me im using phpmyadmin, although in the example i show you on how to do it using the command line)
# Beezleboss
Actually if you’re using win xp by default its already installed (even if you didn’t update your system) .. beside im not updating my own windows box :P … but the situation could be different for you, so i’d suggest you to get windows installer first in order to fix it (via windows update, etc)
well, I got one idea. I have turned OFF automatic updates of windows…some friends told me it sux hard, so should I turn it ON? maybe it will download some new updates etc.
Can you help clairify the ” change the realmlist inside the realmd table to use your own ip address or your dns” sorry been a long day =(
If you’re running windows xp , windows installer by default already installed on your system ;)
and if it’s not working, im sure there’s something wrong with your system configuration
i’d suggest you to search for Windows Installer (instmsi.exe) from the web, and try to reinstall windows installer again
yes I did, but …hmm if I save program, I´ve made “open it with windows installer” & it says just same words like if u type MSIEXEC into “run”
do you know any apache_2.2.6-win32-x86-no_ssl.exe: or .bat? or is it only about settings of PC? eh… :( thanks
did you get the windows installer 3.1 from this page
I´ve downloaded & installed windows installer 3.1 , but how to …start it? I just open .msi & still only at notepad…
what is your operating system ? and btw do you have windows installer instealled on your system ?
if you dont have windows installer installed, go to microsoft.com website and search for it (validation required to get the latest windows installer 3.1)
or you can also try searching around the web to get the direct link to it :P
ah yay this problem sux hard! PLease help! If i double click on apache …. .MSI , it opens notepad with many words & pictures.
HOW TO INSTALL/OPEN .msi?
thanks
Actually the apache installation is only used if you want to create the registration page for your users :)
if you just want so they can connect to your wow server, you just need to change the realmlist inside the realmd table to use your own ip address or your dns
lastly, you need to set up your router to forward port 3724 and 8085
I am trying to make ManGOs live because of some technical problems with wow they cant connect to the actual WoW server we have done technical support with blizz but they had no clue what was wrong. So i wanted to do thios and allow them to play after they bought game cards so im making them pay still for it by buying game cards so we arent hurting blizz’s profits
Ok on your first screenshot it shows you putting localhost for everything how can i use Apache 2.2 and make it to where my friends can connect to the ManGOS Serever and play WoW would i have to creat a static DNS to allow them to connect or can i just use my Ip address?
In simpilir words what would i have to do different from this tutorial to make the server live to the Interweb for my friends?
glad you found the solution :)
TY my skype using port 80 ty wery much u are y hero!
it seems you’ve done everything correctly based from your description but …
have you set up your router to forward port 3724 and 8085 ? (those port used by mangos)
and as for apache you’ll need to forward port 80 (depend on your router type, on some router you must configure apache to listen on different port)
Still need a little help, Have followed your guide a couple of times also tried that Tomcat thing and am able to play on same computer that is running the server but also having many other problems with trying to get friends outside my network to play. I’ve setup a DNS and I’ve also installed Apache, have mangos up and mysql going to. I’ve used SQLLOg to change the realmlist to my DNS but still can’t get it to work. Please email or post back what you need to help me out here. if anythign I’ll delete everything and try and reinstallyour Mangos 4505 setup.
Cn u upload screen shot hot to kill aplication with that port?:)
Tiniux,
you can type netstat /ano from the command prompt and look for something like this :
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1234
if you can see the above line that means there’s a program using port 80 :)
to kill the process that is using port 80, you can go to task manager and look under the process list for the same PID number as the netstat result
and as for editing the drop rate, exp, you can simply open mangosd.conf using Wordpad and look for something like this
# Drop rates
# Default: 1
Rate.Drop.Items = 1
Rate.Drop.Money = 1
# XP rates
# Default: 1
Rate.XP.Kill = 1
Rate.XP.Quest = 1
Rate.XP.Explore = 1
there you can change the drop rate and exp rate ;)
How do i know what application using port 80??
Please write guide about exp and drops.
# Sporky
Im not quite sure what you’re going to do, could you explain it a little bit more ?
# Tiniux
aah do you have any other application using port 80 (listening on port 80) ? if you previously have installed apache, try stopping the apache service first and then uninstall it :)
Hey reaper why when imm installin apache httpd.conf make sock (adress\proxy)
coul not bind 0.0.0.0:80 make sock.
And tahat error all time when im installing apache!
Yea i followed the tutorial i would like to make the server public so my friends can connect i ahve opened port 80 so would i replace my Network name and server name with my ip address or what would i have to do?
did you uninstall the previous apache installation first ? :)
or you can also stop the previous apache service from running (it’d be best to uninstall the previous apache thought) ;)
btw i just uploaded mangos 4505 with new database update from Project Silvermoon :) .. check in on my recent post
And
ERROR:make_sock could not bind 0.0.0.0:80
And one prob when u just install it apache not work :|
Ty wery much u are my hero!
Hey do u can write guides how to config exp drops server config ty ;)