Main Website RSS FeedCurrent Article

Installing and Setting up Apache 2.2 series with PHP 5 on Windows

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 :)

Apache Installation Process

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

Apache Default Page

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

Apache 2.2 Path

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 :

Php loadmodule apache 2.2

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

Apache directory index

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 :

Php extension dir

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

Php dlls

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

Create php test file

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

Apache 2.2 restart

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

Php test page

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 :)

RSS Feed for This Post205 Comment(s)

  1. 1
    Tiniux | Sep 25, 2007 at 0:29 / 12:29 AM | Links to this comments | Reply

    Ty wery much u are my hero!

    Hey do u can write guides how to config exp drops server config ty ;)

  2. 2
    Tiniux | Sep 25, 2007 at 0:32 / 12:32 AM | Links to this comments | Reply

    And one prob when u just install it apache not work :|

  3. 3
    Tiniux | Sep 25, 2007 at 0:51 / 12:51 AM | Links to this comments | Reply

    And

    ERROR:make_sock could not bind 0.0.0.0:80

  4. 4
    Reaper-X | Sep 25, 2007 at 6:18 / 6:18 AM | Links to this comments | Reply

    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

  5. 5
    Sporky | Sep 25, 2007 at 10:49 / 10:49 AM | Links to this comments | Reply

    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?

  6. 6
    Tiniux | Sep 25, 2007 at 18:16 / 6:16 PM | Links to this comments | Reply

    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!

  7. 7
    Reaper-X | Sep 25, 2007 at 18:48 / 6:48 PM | Links to this comments | Reply

    # 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 :)

  8. 8
    Tiniux | Sep 25, 2007 at 19:39 / 7:39 PM | Links to this comments | Reply

    How do i know what application using port 80??

    Please write guide about exp and drops.

  9. 9
    Reaper-X | Sep 25, 2007 at 20:21 / 8:21 PM | Links to this comments | Reply

    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 ;)

  10. 10
    Tiniux | Sep 25, 2007 at 23:32 / 11:32 PM | Links to this comments | Reply

    Cn u upload screen shot hot to kill aplication with that port?:)

  11. 11
    wolfcat | Sep 25, 2007 at 23:45 / 11:45 PM | Links to this comments | Reply

    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.

  12. 12
    Reaper-X | Sep 26, 2007 at 0:40 / 12:40 AM | Links to this comments | Reply

    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)

  13. 13
    Tiniux | Sep 26, 2007 at 0:44 / 12:44 AM | Links to this comments | Reply

    TY my skype using port 80 ty wery much u are y hero!

  14. 14
    Reaper-X | Sep 26, 2007 at 0:45 / 12:45 AM | Links to this comments | Reply

    glad you found the solution :)

  15. 15
    Sporky | Sep 26, 2007 at 10:42 / 10:42 AM | Links to this comments | Reply

    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?

  16. 16
    Reaper-X | Sep 26, 2007 at 21:27 / 9:27 PM | Links to this comments | Reply

    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

  17. 17
    Beezleboss | Sep 26, 2007 at 22:42 / 10:42 PM | Links to this comments | Reply

    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

  18. 18
    Reaper-X | Sep 26, 2007 at 22:56 / 10:56 PM | Links to this comments | Reply

    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

  19. 19
    Beezleboss | Sep 26, 2007 at 23:17 / 11:17 PM | Links to this comments | Reply

    I´ve downloaded & installed windows installer 3.1 , but how to …start it? I just open .msi & still only at notepad…

  20. 20
    Reaper-X | Sep 27, 2007 at 0:47 / 12:47 AM | Links to this comments | Reply

    did you get the windows installer 3.1 from this page

  21. 21
    Beezleboss | Sep 27, 2007 at 20:06 / 8:06 PM | Links to this comments | Reply

    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

  22. 22
    Reaper-X | Sep 28, 2007 at 0:39 / 12:39 AM | Links to this comments | Reply

    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

  23. 23
    Sporky | Sep 28, 2007 at 13:03 / 1:03 PM | Links to this comments | Reply

    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 =(

  24. 24
    Beezleboss | Sep 28, 2007 at 20:27 / 8:27 PM | Links to this comments | Reply

    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.

  25. 25
    Reaper-X | Sep 28, 2007 at 21:12 / 9:12 PM | Links to this comments | Reply

    # 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)

  26. 26
    Beelzeboss | Oct 1, 2007 at 2:25 / 2:25 AM | Links to this comments | Reply

    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 ;)

  27. 27
    Xyan | Oct 3, 2007 at 10:05 / 10:05 AM | Links to this comments | Reply

    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

  28. 28
    Wapazoid | Oct 3, 2007 at 19:57 / 7:57 PM | Links to this comments | Reply

    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!

  29. 29
    Kos | Oct 4, 2007 at 3:51 / 3:51 AM | Links to this comments | Reply

    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.

  30. 30
    Sanyam | Oct 5, 2007 at 11:58 / 11:58 AM | Links to this comments | Reply

    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..

  31. 31
    James | Oct 5, 2007 at 23:25 / 11:25 PM | Links to this comments | Reply

    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?!?!?!

  32. 32
    Reaper-X | Oct 5, 2007 at 23:31 / 11:31 PM | Links to this comments | Reply

    # 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 :)

  33. 33
    James | Oct 5, 2007 at 23:37 / 11:37 PM | Links to this comments | Reply

    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………..??????????????

  34. 34
    James | Oct 5, 2007 at 23:38 / 11:38 PM | Links to this comments | Reply

    Yeah, I already did that. LoL Pretty quick! I still can’t get past this crazy loadmodule error.

  35. 35
    James | Oct 6, 2007 at 7:16 / 7:16 AM | Links to this comments | Reply

    is there a way you can email or something, and help me out? Anyone?????? I’m desperate here!

  36. 36
    Mike2 | Oct 6, 2007 at 14:05 / 2:05 PM | Links to this comments | Reply

    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?

  37. 37
    Reaper-X | Oct 6, 2007 at 14:28 / 2:28 PM | Links to this comments | Reply

    # 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

  38. 38
    Mike | Oct 7, 2007 at 13:21 / 1:21 PM | Links to this comments | Reply

    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?

  39. 39
    Mike2 | Oct 7, 2007 at 22:59 / 10:59 PM | Links to this comments | Reply

    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.

  40. 40
    man | Oct 8, 2007 at 15:28 / 3:28 PM | Links to this comments | Reply

    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

  41. 41
    man | Oct 8, 2007 at 15:42 / 3:42 PM | Links to this comments | Reply

    does anyone know whether the apache documentation talks about installing php, i cant seem to find anything on it

  42. 42
    man | Oct 8, 2007 at 16:15 / 4:15 PM | Links to this comments | Reply

    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

  43. 43
    man | Oct 8, 2007 at 16:18 / 4:18 PM | Links to this comments | Reply

    sorry,i meant system32 and not win32

  44. 44
    Reaper-X | Oct 8, 2007 at 16:59 / 4:59 PM | Links to this comments | Reply

    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 ;)

  45. 45
    Xyan | Oct 10, 2007 at 2:46 / 2:46 AM | Links to this comments | Reply

    what if it is already there?

  46. 46
    Reaper-X | Oct 10, 2007 at 19:22 / 7:22 PM | Links to this comments | Reply

    You can just simply overwrite it or .. backup the old libmysql.dll first and then overwrite it :)

  47. 47
    man | Oct 10, 2007 at 20:26 / 8:26 PM | Links to this comments | Reply

    thanks reaper-x!! you are right, i put them back and i can now access mysql

  48. 48
    Danaki | Oct 11, 2007 at 23:17 / 11:17 PM | Links to this comments | Reply

    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

  49. 49
    Danaki | Oct 11, 2007 at 23:31 / 11:31 PM | Links to this comments | Reply

    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 :)

  50. 50
    Danaki | Oct 11, 2007 at 23:37 / 11:37 PM | Links to this comments | Reply

    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?

  51. 51
    Reaper-X | Oct 12, 2007 at 0:53 / 12:53 AM | Links to this comments | Reply

    # Danaki

    did you enclose the php path using quotes ? ;)

    for example :

    Loadmodule blabla “C:/php/hoho.dl”

    note : don’t copy paste from here because it’ll automatically transform quotes into curly quotes

    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?

    dont worry about it :) .. as for your question :

    the simple answer would be .. yes :) .. unless you change the document root path in your httpd.conf ;)

  52. 52
    John | Oct 12, 2007 at 16:19 / 4:19 PM | Links to this comments | Reply

    I’m back, now curious why Apache loads fine and PHP is configured to the T of your guide, yet all the PHP files I use end up openning a download prompt…

  53. 53
    John | Oct 12, 2007 at 16:24 / 4:24 PM | Links to this comments | Reply

    and what load php module are you talking about? I used the LoadModule php5_module “c:/php-5/php5apache2_2.dll”

    if that’s what you were wondering when you asked Mike2, also I kept the guides directory structure, and configured the php.ini from php.ini-recommended to point to c:\php-5\ext, and the test configuration that comes with apache says it works fine, but it still does the download prompt…

  54. 54
    megavi | Oct 12, 2007 at 23:48 / 11:48 PM | Links to this comments | Reply

    help me plz.. everything is perfect. but my friend cant go to my website.. =( help me plz!!

  55. 55
    ema | Oct 15, 2007 at 7:31 / 7:31 AM | Links to this comments | Reply

    i´ve followed everything you said, but when i tried to do the test he opened test.php direct in dreamweaver. then i´v tryed to restart apache again and now he can´t start, now i really don´t known what to do. can you help please!!!!!!!!!!!!!!

  56. 56
    Reaper-X | Oct 15, 2007 at 9:14 / 9:14 AM | Links to this comments | Reply

    # John

    actually it’s just an example for Danaki :)

    # Megavi

    you’ll need to make sure that you’ve port forwarded the port 80 (or in some case you might need to change the apache port into something else because some isp doesn’t allow you to run your own webserver) :(

    # ema

    i’d suggest you to look at your event viewer log file :)

    control panel -> administrative tools -> event viewer

  57. 57
    ema | Oct 15, 2007 at 17:50 / 5:50 PM | Links to this comments | Reply

    thanks for the tip. Now i can restart apache, but when i test it with localhost/test.php he opens a little window asking me if i want to open or save the dreamweaver document. It´s like he can´t translate php code. what do you think?

  58. 58
    ema | Oct 15, 2007 at 18:31 / 6:31 PM | Links to this comments | Reply

    finnaly i did it, it was two lines of code that were wrong.
    thanks again, you saved me :)

  59. 59
    Reaper-X | Oct 15, 2007 at 18:51 / 6:51 PM | Links to this comments | Reply

    # ema

    your welcome ema :)

  60. 60
    Anthony | Oct 16, 2007 at 8:17 / 8:17 AM | Links to this comments | Reply

    Hey, great guide, but I had a question, when I try to use the sample registration page it says that MySQL Database doesn’t have a field named ‘password’, I went into Navi and saw that the password field is called I, and the passwords are just a bunch of numbers and letters.

    so basically what I am trying to ask, how do I get the registration page to work.

  61. 61
    Reaper-X | Oct 16, 2007 at 9:09 / 9:09 AM | Links to this comments | Reply

    ah you’ll need to get new registration page that support the new version of mangos (previously mangos didn’t use encryption)

    as for the i field, it is encrypted using SHA1 :)

  62. 62
    Mr Neily | Oct 17, 2007 at 1:23 / 1:23 AM | Links to this comments | Reply

    I tried to use SHA1 when i encrypted the password on my page submit and when i try to login to WOW it doesnt recgonize the password. Any idea why?

  63. 63
    Enolam | Oct 17, 2007 at 3:04 / 3:04 AM | Links to this comments | Reply

    Reaper, first I would like to thank you for your wonderful guides! I have one problem.

    I am using a php registration page that has the following lines:

    mysql_select_db(’realmd’);
    $q = “insert into account ( username,I,gmlevel,sessionkey,joindate,banned,last_ip,failed_logins,locked,last_login,online) values (’$u’,'$p’,'1′,”,NOW(),’0′,’127.0.0.1′,’0′,’0′,’2000-01-01 00:00:00′,’0′)”;

    Now, I have to manually add banned as an integer to the field as a bandaid.

    And i changed the password field into an I field so that it points to the right one.

    The problem is that when the page inserts it into the db, in the correct field, it does not encrypt it as the server prgroam does. How do I get that php code to encrypt it so that the server understands it when the plays login?

    Thanks!

  64. 64
    Enolam | Oct 17, 2007 at 3:25 / 3:25 AM | Links to this comments | Reply

    http://us3.php.net/sha1

    That is the website where it has it has a reference to SHA1. I am not a programmer tho. :) any ideas?

  65. 65
    Q-tip | Oct 17, 2007 at 6:31 / 6:31 AM | Links to this comments | Reply

    Add a step 5.1 or 6.1 to add the following to httpd.conf between the tags:

    “AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps”

    (Thanx, “man”)

  66. 66
    Q-tip | Oct 17, 2007 at 6:33 / 6:33 AM | Links to this comments | Reply

    Oops, HTML must be enabled. I meant to say <IfModule mime_module> tags.

  67. 67
    Megavi | Oct 17, 2007 at 11:13 / 11:13 AM | Links to this comments | Reply

    port foward to 80? how to do that?? can i change the name localhost to something else?? and change the website name from localhost to something else??

  68. 68
    Mr Neily | Oct 17, 2007 at 11:14 / 11:14 AM | Links to this comments | Reply

    Why is it when I create an account with password: Passw0rd it comes up as
    96e0dcdc5e4933cacc907ff742f356e8b96a9452

    but when i try to use the creation page with SHA1 encryption it comes up as:

    ebfc7910077770c8340f63cd2dca2ac1f120444f

    What else is used for the encryption of the passwords when they are submitted?

    Thanks for your help.

  69. 69
    Megavi | Oct 17, 2007 at 11:21 / 11:21 AM | Links to this comments | Reply

    can i change 127.0.0.1 to something else??

  70. 70
    Reaper-X | Oct 17, 2007 at 11:46 / 11:46 AM | Links to this comments | Reply

    # Mr Neily and Enolam

    Actually mangos use this function to encrypt your password (not normal sha1) :

    if(!loginDatabase.PExecute(”INSERT INTO `account`(`username`,`I`,`joindate`) VALUES(’%s’,SHA1(CONCAT(UPPER(’%s’),’:',UPPER(’%s’))),NOW())”, username.c_str(), username.c_str(), password.c_str()))
    return -1;

    in order to test it directly without creating code :

    1. open command prompt and type mysql -u root -p
    2. type this :

    SELECT SHA1(CONCAT(UPPER(’username’),’:',UPPER(’password’)));

    for example you created a username with this info :

    user : testingz
    password : Passw0rd

    mangos return :
    ebdbe665dd1fdccc6ca6621ca2ab082e883f1f35

    now try using the above mysql function :

    SELECT SHA1(CONCAT(UPPER(’testingz’),’:',UPPER(’Passw0rd’)));

    and you’ll get :

    +——————————————————-+
    | SHA1(CONCAT(UPPER(’testingz’),’:',UPPER(’passw0rd’))) |
    +——————————————————-+
    | ebdbe665dd1fdccc6ca6621ca2ab082e883f1f35 |
    +——————————————————-+

    that’s it :D

    # Megavi

    Changing 127.0.0.1 ? actually that’s a loopback address :)

    # Q-Tip

    thank you very much, although i did use it on the sample configuration, but i forget to include that in this post :D

  71. 71
    Mr Neily | Oct 17, 2007 at 12:08 / 12:08 PM | Links to this comments | Reply

    Thanks for the help with that.

  72. 72
    B | Oct 19, 2007 at 12:43 / 12:43 PM | Links to this comments | Reply

    ok so i got everything to work up until the last part where u type in u web browser “http://localhost/test.php” its not working…. it doesn’t come up with anything….help?

  73. 73
    B | Oct 19, 2007 at 13:01 / 1:01 PM | Links to this comments | Reply

    i have tried everything and all the parts work until i point my browser to my test.php and nothing happens….im confused

  74. 74
    Reaper-X | Oct 19, 2007 at 17:58 / 5:58 PM | Links to this comments | Reply

    doesnt come up with anything ? does that mean there’s no 404 not found error message too ? i’d suggest you to look at your apache error.log first :)

  75. 75
    Almost there in NY | Oct 21, 2007 at 8:31 / 8:31 AM | Links to this comments | Reply

    When I put in http://localhost/ I get the it works message. When I put in http://localhost/test.php I get page cannot be found error. Even if I try to pull up an html document from the server it does not pull it up I still get a page connot be found error. I was wondering if you might have some suggestions for me?

  76. 76
    B | Oct 22, 2007 at 5:19 / 5:19 AM | Links to this comments | Reply

    i have no error messages and everything works fine but the test.php doesn’t work at all

  77. 77
    elliott | Oct 23, 2007 at 7:11 / 7:11 AM | Links to this comments | Reply

    sorry to bug you again but, i cant get a registration template to work write.. is this html correct? :

    <?php
    /* Thanks to Peec for these nice functions */
    function check_for_symbols($string){
    $len=strlen($string);
    $alowed_chars=”abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ123456789″;
    for($i=0;$i ‘localhost’,'db_username’ => ‘createuser’,'db_password’ => ‘create’,'db_name’ => ‘realmd’,);
    $username = $_POST['username'];
    $password = sha_password($username,$_POST['password1']);
    $email = $_POST['email'];
    $tbc = ( $_POST[bc] == “on” ) ? “1″ : “0″ ;
    $realmd_bc_new_connect = mysql_connect($realmd[db_host],$realmd[db_username],$realmd[db_password]);
    mysql_select_db($realmd[db_name],$realmd_bc_new_connect);
    mysql_query(”INSERT INTO account (username,I,email,tbc) VALUES (’$username’,'$password’,'$email’,$tbc)”);
    $error = “Errors: “.mysql_error().”\n”;
    mysql_close();
    if ($error == “Errors: “.”\n”)
    {
    echo ”;
    echo “Welcome “.$_POST[username].”";
    echo “your email is: “.$_POST[email].”";
    echo “your Burning crusade status is:”.$_POST[bc].”";
    }
    else if ($error == “Errors: Duplicate entry ‘”.$_POST[username].”‘ for key ‘idx_username’”.”\n”)
    {
    echo ” ERROR: USERNAME TAKEN”;
    }
    else if ($error != “Errors: “.”\n”)
    {
    echo ” ERROR: UNKNOWN ERROR, contact bigfootmech@”;
    echo “gamil.com”;
    echo “”;
    echo $error;
    }
    else{
    echo “Writing Error, contact bigfootmech@”;
    echo “gamil.com”;
    }
    }else{
    echo “ERROR: Passwords don’t match”;
    }
    }else{
    echo “ERROR: INVALID CHARACTERS USED IN THE PASSWORD”;
    }
    }else{
    echo “ERROR: INVALID CHARACTERS USED IN THE USERNAME”;
    }
    }else{
    echo “ERROR: ENTER A PASSWORD”;
    }
    }else{
    echo “ERROR: ENTER A USERNAME”;
    }
    }else{
    ?>
    <form action=”" method=”POST”>
    Username:

    Password (and confirm):

    Email you use (optional) - Your password can be sent to this email if you lose it:

    Burning Crusade?:

  78. 78
    elliott | Oct 24, 2007 at 8:19 / 8:19 AM | Links to this comments | Reply

    yeah once i find out how to set it up on apache.. how can i set it up on the web?

  79. 79
    aivanho | Oct 25, 2007 at 22:12 / 10:12 PM | Links to this comments | Reply

    I have a problem is: “Invalid LoadModule path \x93d:/php-5/php5apache2_2.dll\x94
    Can you reply for me as soon as possible, thanks in advanced!

  80. 80
    somejoe | Oct 27, 2007 at 14:02 / 2:02 PM | Links to this comments | Reply

    Hay, thanks for the great tutorial. I did the first one then found the updated progs one here and so far all is excellent.

    Except for the signup page. I have move it into the required dir, and it can be accessed, but it doesnt show online people and when i try and make an account and hit submit i get error 500
    “There is a problem with the page you are trying to reach and it cannot be displayed.”

    any idea’s?

    thanks in advance

  81. 81
    Vishal | Oct 28, 2007 at 19:27 / 7:27 PM | Links to this comments | Reply

    Hello,
    I am just read your guide, and found help full. But i have one suggestion, You can add list of files to be copyed to system folder from php folder.
    You add a picture, this is good. But differnet machine have differnet screen resolution and hard to find files for them.

    Thanks,
    Vishal
    vishalgaurav01@gmail.com

  82. 82
    paged | Oct 28, 2007 at 22:59 / 10:59 PM | Links to this comments | Reply

    Hi,
    I am able to install apache and php on my machine and get info about php verson.
    But when i am trying to test this nothing is displayed

    Hello World Script

    <?php
    echo “Hello World!”
    ?>

  83. 83
    Joe | Oct 30, 2007 at 9:30 / 9:30 AM | Links to this comments | Reply

    i am getting the 404 not found error in my error log it says script ‘D:/Program Files/Apache Software Foundation/Apache2.2/htdocs/test.php’ not found or unable to statt

  84. 84
    vishal | Nov 1, 2007 at 20:03 / 8:03 PM | Links to this comments | Reply

    Hello,
    If you are see 404 server error.First check that you are successfully installed apache and php on your system. And goto your apache installtion directory and open htdocs folder, then create test.php .
    Make sure that test file must have .php extension. some time you rename file, but it donot rellay changes to .php.

    Hope this tips is help you.
    Thanks,
    Vishal
    vishalgaurav01@gmail.com
    linuxvishal@yahoo.com

  85. 85
    Joe | Nov 1, 2007 at 23:32 / 11:32 PM | Links to this comments | Reply

    Ok i fixed my server 404 error with windows xp(maybe vista too not sure) it hides your file extension ex. i renamed my test file test.php but since windows xp hides the extension it was really
    test.php.txt i did a quick google search and the only way i could find to change extensions in xp is to open any folder go to tools>folder options>view and uncheck hide extensions for known file types(i didnt look long there may be better ways) now all your extensions should be showing and renaming the files\extensions will work right

  86. 86
    Joe | Nov 1, 2007 at 23:35 / 11:35 PM | Links to this comments | Reply

    oh and thanks vishal even though that wasnt exactly the solution i looked into a bit more, reaper i would suggest adding this info to your guide for xp users(and maybe vista) and thanks for your awsome and easy guides

  87. 87
    Muskar | Nov 2, 2007 at 1:46 / 1:46 AM | Links to this comments | Reply

    Yet again, thanks for the awesome guides.

    I completed every step so far, and everything was working until this:

    This is what happens in my CMD in step 9:
    I type
    ‘net stop apache2.2 && net start apache2.2′

    And this happens:
    ‘The Apache2.2 server is stopping.
    The Apache2.2 server was stopped successfully.

    The Apache 2.2 service is starting.
    The Apache 2.2 service could not be started.

    There was a servicespecific error: 1

    There is more help available if you type NET HELPMSGR 3547′

    (This is the translated version, as I do not use an english version of windows).

    # aivanho
    Did you install PHP 5 in ‘D:/php-5/’ ?
    If not, then adjust it, as the default drive is ‘C:/’
    If it is the correct drive, then I’m afraid I’m unable to help you. I wouldn’t be here if I wasn’t new at using Apache and PHP.

  88. 88
    vishal | Nov 2, 2007 at 15:51 / 3:51 PM | Links to this comments | Reply

    Hello,
    I under stand your problem. you are faceing apaceh restarting problem. Its some times accures, when you donot successfully edit httpd.conf file in apache conf folder.

    I suggested you, first download file from this site httpd.conf file, just over write it into your apache conf folder. And make sure where you are extrait php. default folder in this guide is c:\php-5
    And make sure that php-5 is root directory in c: drive. And all php .dll and files are stored in this folder with out any sub directory.

    If you are create php-5 folder in d: drive and edit line in httpd.conf file.
    If you donot know how to edit files and your are new lerners, i suggested you, just create a folder is c: drive with php-5.

    Hope this will help you. My english is not too good.

    Thanks,
    Vishal
    vishalgaurav01@gmail.com
    linuxvishal@yahoo.com

  89. 89
    Muskar | Nov 2, 2007 at 20:48 / 8:48 PM | Links to this comments | Reply

    I hope there will be comments today, or some time soon.
    If I forgot to specify something before you can make a reply, please tell me what it is.

  90. 90
    Muskar | Nov 2, 2007 at 21:16 / 9:16 PM | Links to this comments | Reply

    Well, ok, it’s no problem with the english, and I’m not new at using my computer for technical reasons.

    I will respond how it works. (I suddenly remember an error I got before step 9, I’m pretty sure it was something like “Invalid LoadModule path \x93d:/php-5/php5apache2_2.dll\x94″ as [b]elliott[\b] said.

    (sorry for this, just testing fast:
    [b]test[/b] - BBCode small
    [B]test[/B] - BBCode large
    test - html standard
    test) html advanced

  91. 91
    Muskar | Nov 2, 2007 at 21:34 / 9:34 PM | Links to this comments | Reply

    TEST - SORRY
    Did my comment not appear?
    It doesn’t show up even if I restart my browser.
    TEST - SORRY

  92. 92
    Muskar | Nov 2, 2007 at 21:36 / 9:36 PM | Links to this comments | Reply

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |—————————————|
    |Darn it didn’t appear, here goes again.|
    |—————————————|
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    Well, ok, it’s no problem with the english, and I’m not new at using my computer for technical reasons.

    I will respond how it works. (I suddenly remember an error I got before step 9, I’m pretty sure it was something like “Invalid LoadModule path \x93d:/php-5/php5apache2_2.dll\x94″ as [b]elliott[\b] said.

    (sorry for this, just testing fast:
    [b]test[/b] - BBCode small
    [B]test[/B] - BBCode large
    test - html standard
    test) html advanced

  93. 93
    Muskar | Nov 2, 2007 at 21:37 / 9:37 PM | Links to this comments | Reply

    Well, ok, it’s no problem with the english, and I’m not new at using my computer for technical reasons.

    I will respond how it works. (I suddenly remember an error I got before step 9, I’m pretty sure it was something like “Invalid LoadModule path \x93d:/php-5/php5apache2_2.dll\x94″ as elliot said.

    TESTING IF IT WORKS WITHOUT MY HTML CODES

  94. 94
    Muskar | Nov 2, 2007 at 21:37 / 9:37 PM | Links to this comments | Reply

    it did..
    (sorry for this, just testing fast:
    [b]test[/b] - BBCode small
    [B]test[/B] - BBCode large
    test - html standard
    test) html advanced

  95. 95
    Muskar | Nov 2, 2007 at 21:39 / 9:39 PM | Links to this comments | Reply

    Hmm, each time I include a [ b ], or it doesn’t sumbit the page, it refreshes it instead. Whatever anyways, sorry for bothering you.

  96. 96
    Muskar | Nov 2, 2007 at 21:40 / 9:40 PM | Links to this comments | Reply

    rofl, this time it worked? >.<

  97. 97
    Reaper-X | Nov 2, 2007 at 21:42 / 9:42 PM | Links to this comments | Reply

    Invalid Loadmodule path ?

    did you enclose the path name using double quotes ? "D:/php-5/php5apache2_2.dll"

    (you can safely copy the above text, i’ve make sure that it doesn’t get transformed into curly quote) :)

  98. 98
    Reaper-X | Nov 2, 2007 at 21:49 / 9:49 PM | Links to this comments | Reply

    # Muskar

    Actually your previous 3 comments got caught in my automatic spam filtering (usually spammers use bbcode combined with html simultaneously)

    and fortunately i checked my spam area today (usually not), and found your comment there or else you’ll be flagged as spammer on various website that use the same spam filtering lol

  99. 99
    Muskar | Nov 3, 2007 at 0:12 / 12:12 AM | Links to this comments | Reply

    #Reaper-X
    Yes actually I did, I copy pasted the one you posted. But as you say, it was incorrect;
    Your previous:
    LoadModule php5_module “c:/php-5/php5apache2_2.dll”
    The line in the downloadable file:
    LoadModule php5_module “c:/php-5/php5apache2_2.dll”

    #Reaper-X
    Argh lol >.<

  100. 100
    Muskar | Nov 3, 2007 at 0:15 / 12:15 AM | Links to this comments | Reply

    hmm you dont see the difference there… but the first one is quote marks that my keyboard doesn’t support (the main reason I copy pasted it), the second is bolded normal quote marks.

  101. 101
    vishal | Nov 3, 2007 at 1:31 / 1:31 AM | Links to this comments | Reply

    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

  102. 102
    vishal | Nov 3, 2007 at 1:39 / 1:39 AM | Links to this comments | Reply

    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

  103. 103
    Muskar | Nov 3, 2007 at 2:13 / 2:13 AM | Links to this comments | Reply

    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:

  104. 104
    vishal | Nov 3, 2007 at 2:27 / 2:27 AM | Links to this comments | Reply

    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

  105. 105
    Muskar | Nov 3, 2007 at 18:55 / 6:55 PM | Links to this comments | Reply

    Ok, did you send it to him?

  106. 106
    Rappe | Nov 4, 2007 at 3:22 / 3:22 AM | Links to this comments | Reply

    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

  107. 107
    Rappe | Nov 4, 2007 at 3:35 / 3:35 AM | Links to this comments | Reply

    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

  108. 108
    Rappe | Nov 4, 2007 at 3:36 / 3:36 AM | Links to this comments | Reply

    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

  109. 109
    Tom | Nov 4, 2007 at 15:50 / 3:50 PM | Links to this comments | Reply

    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.

  110. 110
    vishal | Nov 4, 2007 at 17:57 / 5:57 PM | Links to this comments | Reply

    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

  111. 111
    vishal | Nov 4, 2007 at 18:05 / 6:05 PM | Links to this comments | Reply

    Sorry,
    this line is not appear on post.
    IfModule mime_modul

    Thanks,
    Vishal
    vishalgaurav01@gmail.com
    linuxvishal@yahoo.com

  112. 112
    vishal | Nov 4, 2007 at 18:13 / 6:13 PM | Links to this comments | Reply

    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

  113. 113
    Rappe | Nov 4, 2007 at 18:59 / 6:59 PM | Links to this comments | Reply

    And what shoudl I look at then at the http.conf file? cause I just added and editted the things reaper said :s

  114. 114
    vishal | Nov 4, 2007 at 19:55 / 7:55 PM | Links to this comments | Reply

    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

  115. 115
    Rappe | Nov 4, 2007 at 22:16 / 10:16 PM | Links to this comments | Reply

    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?

  116. 116
    Rappe | Nov 4, 2007 at 22:19 / 10:19 PM | Links to this comments | Reply

    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

  117. 117
    scottH | Nov 5, 2007 at 6:05 / 6:05 AM | Links to this comments | Reply

    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.

  118. 118
    elliott | Nov 5, 2007 at 19:28 / 7:28 PM | Links to this comments | Reply

    do you know of any premade registration temlates that work for your mangos

  119. 119
    Reaper-X | Nov 5, 2007 at 19:46 / 7:46 PM | Links to this comments | Reply

    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 :)

  120. 120
    Rappe | Nov 5, 2007 at 23:08 / 11:08 PM | Links to this comments | Reply

    whats the mangos forum?

  121. 121
    Rappe | Nov 6, 2007 at 0:12 / 12:12 AM | Links to this comments | Reply

    can you give a link to a premade file or soemthing cause I can’t find anything.

  122. 122
    elliott | Nov 8, 2007 at 23:20 / 11:20 PM | Links to this comments | Reply

    yeah i need one 2.. all the ones i’v found dont work right

  123. 123
    Rappe | Nov 9, 2007 at 3:53 / 3:53 AM |