Install PHP under Apache and Vista

June 6, 2007

I initially tried the msi installer for PHP 5. Unfortunately, it installs only PHP under CGI, which although it has some performance and security issues, might be ok for a quick and dirty development environment.

But the installer is badly broken. You’ll get an error something like

PHP Fatal error:  require_once()[function.require]: Failed opening
required 'SAM/php_sam.php' (include_path='.;C:php5pear') in
sam_factory on line 1

After fighting this for a couple of hours, I ended up installing manually anyway. I used this procedure to get PHP 5 running under Vista:

  1. Install the Apache webserver.
  2. Get the current version of PHP 5 from http://www.php.net/downloads.php#v5. (It’s 5.2.3 at this time). Get both the zip file and the PECL zip file (which includes extensions).
  3. Uninstall any previous installations of PHP 5 (Start > Control Panel > Programs and Features). You may have to reboot your machine.
  4. Disconnect from the Internet. Turn off your firewall. Turn off your virus checker.
  5. Turn off User Account Control (UAC).
  6. Get an administrator prompt by going to All Programs > Accessories. Right-Click “Command Prompt” and choose “Run as Administrator”
  7. Use the command prompt to manually remove directories containing previous PHP installations (like C:\Program Files\PHP…)
  8. Go to the directory where you’ve downloaded the PHP5 and PECL zipfiles. Extract the PHP zipfile. Rename the extracted php directory (which has a name something like php-5.2.3-Win32) to c:\php. Extract the PECL zipfile into c:\php\ext.
  9. In the command prompt, type:
    cd c:\php
    mkdir upload
    mkdir session
    copy php.ini-recommended php.ini
  10. Open php.ini in Notepad:
    1. There are many variables… the following are important. Notice that starting a line with a semicolon in the ini file comments it out.
      extension_dir ="C:\php\ext"
      display_errors = Off
      log_errors = On
      error_log = "C:\php\error_log"
    2. You might want to look at upload_max_filesize. I’ve set mine to 16M. I also set post_max_size = 16M.
    3. Enable the extensions you need by deleting the semicolon at the beginning of the line. These will depend on your application… I’m going to be using MySQL (which I’ve already installed) and Moodle (which I’ll install later). My list looks like the following:
  11. Right-Click on Start > Computer. Choose “Properties”, then “Advanced”. Click on “Environment Variables”. Click on PATH, then Edit… and add “;C:\php;c:\php\ext” (without quotes) to the end of the variable.
  12. Open your Apache configuration file (All Programs > Apache HTTP Server 2.2.x > Configure Apache Server > Edit the Apache httpd.conf Configuration File). Add the following lines:
    LoadModule php5_module "C:\php\php5apache2_2.dll"
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir "C:\php"

    (UPDATE: When I installed PHP 5.2.13 using this procedure (July 2010) under Apache 2.2.15, I found that I had to delete that last line (the PHPIniDir directive) or Apache wouldn’t start.)

    Look for the DirectoryIndex line. Add ” index.php” (no quotes) to the end of that line.

    Save the file.

  13. Create a file named test.php in your Apache htdocs directory, containing this text: <?php phpinfo(); ?>
  14. Reboot your machine.
  15. Browse to http://localhost/test.php. You should see tabulated information about your working PHP installation.


  1. Thanks, this was a lifesaver. I’d been trying to install for weeks and this works perfect.

  2. I tried to install MySQL which went pretty smooth. However, configuring it was a problem. I opened up port 3306 but it still gives me a port 3306 error. Can you help? Thank you

  3. Hi-

    I tried to install php and open to my explorer but i got error. I copied it here. Please help me. Thanks

    Server Error in Application “Default Web Site”


    HTTP Error 404.0 – Not Found
    Description: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    Error Code: 0x80070002

    Notification: MapRequestHandler

    Module: IIS Web Core

    Requested URL: http://localhost:80/test.php

    Physical Path: C:\inetpub\wwwroot\test.php

    Logon User: Anonymous

    Logon Method: Anonymous

    Handler: StaticFile

    Most likely causes:

    The directory or file specified does not exist on the Web server.
    The URL contains a typographical error.
    A custom filter or module, such as URLScan, restricts access to the file.
    What you can try:

    Create the content on the Web server.
    Review the browser URL.
    Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.
    More Information… This error means that the file or directory does not exist on the server. Create the file or directory and try the request again.

    Server Version Information: Internet Information Services 7.0.

  4. This worked out great for me! Thank you.

    Did you create the test.php file and put it in the directory “C:\inetpub\wwwroot\”?

    It looks like apache is setup properly but the browser just isn’t finding the test.php file in your wwwroot.

  5. I got php and apache to work, but still get mysql working with php.

    I installed mysql and am able to access it via the prompt.

    PhP and Apache are installed and working.

    I removed the semi-colon from the line

    and did everything else this post describes but still get the following error when trying to view any of my php scripts that use mysql:
    “Fatal error: Call to undefined function mysql_connect() in X”
    where X equals the php file.

    I’ve uninstalled everything and re-installed it all from an Administrative Command Prompt and still get stuck with the same error.

    I’m running Vista Home on a core 2 duo, UAC is disabled.

    Any ideas?

    Thanks in advance!

  6. sorry, I meant mysql WON’T work with php. php doesn’t seem to be loading the extensions even though the extension_dir line is uncommented and pointing to the right ext dir with the pecl extension files.

  7. I got the test.php script to work. I have an index.php in my folder with the test.php script. When I try to open up index.php I get a dialog box asking me how I want to open the file. Test.php works fine. Can anyone help me on this?

  8. Another note of appreciation.

    I wasted a good 2 days of my life mucking around, trying to get PHP running under Vista.

    I read your post, followed your instructions and voila, success!

    Now, on to MySQL.

    Thanks again.

  9. Again, very nice tutorial. I was able to get both apache and php up and running in no time at all!


  10. Grrr – Apache installed fine, but when I added PHP, the service (apache) won’t start.

    I hate stupid Microsoft.

  11. After using the php5 msi apache can’t find the conf file. Must be permissions, but I haven’t figured it out yet.

  12. Great tutorial. Managed to get both apache and php running.

  13. Followed your directions for installing both Apache and PHP under Vista. Apache’s worked great so far, no problems, but after following directions for PHP (step by step, word for word) I get a 404 error when searching for localhost/test.php. I know it’s probably something simple, but I still can’t find it after 2 days of searching. Can anyone offer ideas? thx

  14. Hi very helpfull tutorial indeed.
    just a small advice if you still have a problem running apache after installing php try -not- to include following lines into apache config file:
    AcceptPathInfo on
    PHPIniDir “C:\php”


    • Max thank you for the small advice this fixed my problem 🙂

  15. Max

    Commented those 2 lines out of the httpd file, but still no change. Still getting just a plain 404 error and I can see the file is physically where it is supposed to be (C:\apache\htdocs). Thanks for the idea.

    From the error log:

    [Sun Aug 05 09:01:15 2007] [error] [client] script ‘C:/apache/htdocs/test.php’ not found or unable to stat

  16. Hey Chris,

    1. I hope you are trying to open it like this: http://localhost/test.php because C:/apache/htdocs/test.php’ will not work.
    2. When you configure apache according to the above tutorial try to put this lines:
    (LoadModule php5_module “C:\php\php5apache2_2.dll” and
    AddType application/x-httpd-php .php)
    in a proper position in configuration file(you will see some similar fields in it).
    3. And don’t forget to restart apache every time you change something in configuration. In my case I had to restart the whole system, because (net stop/start apache did not work)

    Hope it will help.

    P.S. In my case I’ve installed MySQL,PHP and apache on Vista Ultimate edition, so maybe there is a bug in other editions however I doubt this, just try to go thru everything step by step again.

  17. thank god for you. there’s no way i wanted to sit down and map config thru vista.

  18. Nice one, this tutorial and the one on Apache were great…gonna try MySQL now, fingers crossed this is gonna go jus as smooth.

    Thanks for the article

  19. I worked through this paper to install MySQL…the only real thing that was different from a regular .exe file install was disabling UAC first and then running it…working fine now!

    I did get one error just after mysql tries to connect to server but I hit the retry key and it was fine and I connected using my mysql gui “sqlyog” just fine


  20. Fortunately I didn’t need to go through the whole script to get php and apache working on Vista… but there is now a problem I can’t work out with MS SQL. All the following is working fine on Windows XP using PHP 4.4.4.

    The php script content.php includes head.inc. In head .inc we obtain the title name for a page with a db query for example:

    $title = $db->GetOne($q) or $db->ErrorMsg().$q;

    with say:

    $q = ‘Select pname from pal where pge = $page’;

    Now I have checked the $db->Connect statement and it gets the server, database username, password etc…. perfectly and establishes a connection.

    So I can’t see any connection issues but it simply stops.

    any suggestions?
    I’ve been working on this most of the day and it’s driving me nuts.


    I’ve put many print statements to debug… however the print statement after the $db->GetOne statement does not print out, there is no error message, just no page displayed.

  21. Again….WONDEFUL!!!

  22. I installed the PHP 5.2.3 and PECL zip file exactly as described in this tutorial.

    Modified the httpd.conf to add:
    LoadModule php5_module “C:\php\php5apache2_2.dll”
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir “C:\php”

    However, C:\php\php5apache2_2.dll simply doesn’t exist in the C:\php directory. So where does this file com from? Is it built/compiled after the installation of all source code and extensions?

    Any suggestions would be greatly appreciated, Thanks!


  23. I figured out the solution to my earlier question.

    I need to download and install php-5.2-dev (zip) from http://snaps.php.net/. That package contains lots of DLLs including the missing php5apache2_2.dll.

    Big thanks to the tutorial author. Without his installation steps I most likely am still trying to figure out how to install it under Vista.

  24. I followed guide and read all emails. I get the 404 error and can’t find test.php even though I’m using http://localhost/test.php and the file is physically where it belongs. If I load the file with File-Open, I get a message box saying “Do you want to save or open this file” and each time I click it, I get a window that appears and goes away so fast I can’t see what it would say, then I get the message box for ‘save or open’ again. This repeats.

    thanks for any suggestions.

  25. Awesome Tutorial!

    I followed every step and it worked on the first try.

    If it helps anyone, this is what I installed on Vista basic:


    Thanks again

  26. You are the MAN!!! It rocks…I successfully integrated PHP and Apache…on my way to MYSQL

  27. This is a great tutorial. Thanks bro

    But i still have a problem. For example… test file if i write without “php”, the file doesn’t appear. I need to write in order to get this file run successfully.

    seem oppening php coding must be written in full !!!

  28. Again, an awesome walk-thru. Worked perfectly, thanks.

  29. try this:
    LoadModule php5_module “C:\php\php5apache2.dll”
    AddType application/x-httpd-php .php .php3 .php5 .phtml
    AddType application/x-httpd-php-source .phps
    PHPIniDir “C:\php\php.ini”
    In the end of the file.

    If you are using apache 2.0.X worked for me

  30. i can open up the http://localhost/test.php and it gives me all the info…. but i can not find my wwwroot i tried searching my computer for it but still can not find it…. and i know you need one to do your php websites…. any idea what to do????

  31. hi
    i have installed apahe, it runs fine
    the trouble is that when install php…and configure the httpd.conf file
    and add
    LoadModulephp5_module “C:\php\php5apache2.dll”
    PHPIniDir “C:\php”
    it doesnt let me restart the apache…
    i am running vista….apache works fine, without the above lines….
    when i was setting up the server for php, i choose apache cgi(there were a few other opptions of apache to select from….
    any suggestions?

  32. I figured out the solution to my earlier question.

    I need to download and install php-5.2-dev (zip) from http://snaps.php.net/. That package contains lots of DLLs including the missing php5apache2_2.dll.

    Big thanks to the tutorial author. Without his installation steps I most likely am still trying to figure out how to install it under Vista.
    ben wrote above….
    where are we supposed to extract that package???

  33. i hope you come back to check on this board…for answers to your problems……jessi
    the root directory, if you havent set any……. is htdocs
    it supposed to be in your apache directory….
    htdocs, is ure root directory, unless you set one….which in your case, i think you dint….

    neway, is there anyone here who has a solution to my problem?????

  34. […] i came across this helpful post by senese: Installing PHP under Apache and Vista. I was able to get PHP working correctly, finally! Some steps may seem unnecessary (such as […]

  35. k does anyone have a soltution to my probelms, above???

  36. I have installed everything and everything seems to work file. But every php script that I run that has HTML embedded does not show up. It just shows up as an empty site. The Title shows up and i get no other error. Can someone help me out? thank you all in advance

  37. Since you’re running under Apache and not IIS, ought you not to leave cgi.force_redirect=0 as cgi.force_redirect=1? The web page here – http://uk3.php.net/releases/4_1_2_win32.php- is quite explicit that turning it off is needed and recommended only for IIS.

  38. Great Tutorial!

    I did have one problem, the service wouldn’t start after doing all the steps above. Changing the following line:

    PHPIniDir “C:\PHP”
    PHPIniDir “C:\PHP\”

    fixed the problem.

  39. Like many other comments above, I had spent days figuring out how to set this thing up. Your tutorial really safe my life!!!

    Thank you very much!!!

  40. Thank you so much for this really helpful tutorial. I followed these instructions and Apache/PHPE worked first time. Haven’t tried MySQL yet. Brilliant!

  41. Thanks a mill…yet to try mysql. but this is a life savior!

    Apache 2.2.6 php 5.2.5..vista home prem.

  42. Thanks it works just great.

  43. You legend! You’ve saved me much head scratching. Thanks.

  44. Thanks so much for putting this up. Please keep it up here too! I was so frustrated and lost with installing PHP and getting it to work with apache. I’m a novice programmer and I thought I would use this winter break from school to learn some PHP, and you have made that possible!

  45. You can try XAMPP or WITSuite (installation video: http://www.witsuite.com/products/installer/).

  46. I have followed the tutorial above,and many other tutorials to try and get php5 working with apache on windows vista, however when i try to open localhost/test.php i get a message box asking if i want to open or save the file.If i click open it opens it upi n dreamweaver. Any ideas before i go mad and bin the laptop!!!

    Cheers in advance

  47. i did everything stated and it turned out fine but when i try write my own code and save it in htdocs and try to access the script, via web, it doesn’t show up.
    any help??

  48. Ok the error above has been sorted, but now i start my Apache server, i see a few people have had the same problem, but cant seem to find a definative fix,have trie everything mentioned above,but still cant start it,if i change the LoadModule php5_module “C:\php\php5apache2_2.dll” to LoadModule php5_module “C:\php\php5apache2.dll” it startes but when i open localhost/test.php i just get the code displayed on the browser………any ideas for either problem????

  49. sorry,meant to say it wont start in above post

  50. After smashing my head off a wall for 5 hours and trying 3 or 4 sites with “solutions”, this one nailed it for me. My initial problems were related to IIS7 clashing with Apache. After I removed IIS7 and followed these, I was able to get it to work. I had the visible code problem too – meaning PHP interpolator is not being invoked.

    Other points – make sure Apache service is stopped (if you have php as a sub directory of Apache) and you are deleting old php versions in that dir. There was a tip about not installing Apache in a dir with spaces as in “C:\Program Files”.

    My php ini was “tweaked” already in C:\Windows – but I added the PHPIniDir “C:\Windows” to httpd-conf anyway. As %SYSTEMROOT% this should be unnecessary. I set the “Listen” parameter to 80 and Servername as localhost since i plan to do local development for testing and not actually deploy. MY ISP is not setup to allow me to “host” anyway. Maybe getting this local setup to work is a place to start for those wanting to deploy on a network or the internet, then mod the IP and port info later when you want to deploy.

    Also I found I had to Modify the Security permissions on my Apache and php folders to add my admin account and give it full control (or modify) in order to save php.ini and httpd-conf. Vista doesn’t have groups it seems, so you can’t simply add the admin account to the Administrators group.

    Thanks a million Mr. Senese for a working solution.


  51. Thanks for this quick and easy way to get up and running with PHP. I’m new to PHP and this was great!

  52. I have some problems getting results from form submission when using just the file name in action attribute i.e action=”update.php”. file exist but shows errors like: HTTP 404 Not Found. Am using PHP5, Apache2 on Vista home premium. Any help ‘ll be appreciated!

  53. Thank you so much!

  54. Thanks for the humungous help! However, after carefully following your instructions, I was still getting an internal server error (http #500) when trying to load the phpinfo test page.

    Joe Orr’s suggestion to add a backslash to the end of the ini path fixed the problem! Change

    PHPIniDir “C:\PHP”
    PHPIniDir “C:\PHP\”

    Thank you everyone. Why the heck isn’t there a “packaged” version to do all this boloney for us? What a waste of good time! Anyway I thought I would also pass on that I just ran into something called WAMP, which may be worth exploring, as it is supposed to install Apache/MySQL/PHP onto Windows all at once! Anyone have any experience with this?

  55. Thank you so much. I don’t want to broadcast my oops, however if it saves anyone an hour, it’s worth it. Double check that you didn’t extract your php directory in Program Files like I did… it needs to be at the root directory C:\php\. Also, I didn’t know where to put the additional config information, so the person who added “at the end of the config file” really helped me a lot. Thanks again for taking the time to post this.

  56. Hey, thanks man. Very good indeed, never could’ve done it without this, thanks for all your hard work. Had previously installed on XP and was OK but was stumped on Vista.

    BTW – I didn’t disconnect from internet, or turn off firewall or anti-virus and it sill worked a charm.

    Thanks once again, where would be without someone posting their knowledge to help the rest of us out?

  57. Can i turn on UAC after i installed php?

  58. The apache server seems to be working for me because at localhost I could see the page indicating successful installation of apache. However, when tried again I get a listing of files page instead of the apache page. What could be wrong ?

  59. By listing of files I meant that it shows me directory listing of htdocs dir instead of apache page. Please help. Thanks.

  60. Great Article! Worked great….now for MYSQL

  61. Thank you so much. I managed to get php working under windows with IIS but it was so much hassel. It too me about a week. Now I have vista with no web server. I followed you instruction and had php working under an hour. Thanks so much!!!!!!

  62. As others have reported, I also get a 404 Not Found Error when trying to access the test.php file via http://localhost/test.php, which is within /htdocs/.

    I cannot find a solution or cause to this issue. Any advice really appriciated!!! Thanks for the steps.

  63. Yo, I seriously was trying for hours and hours, trying to follow dozens of tutorials and instructions to get php working on vista for web dev purposes. I tried IIS and then tried manually installing php4 and then php5 and each time couldn’t get past the part about handler mapping cause it kept saying something about a module list. Then I tried installing Wamp server and I couldn’t get the localhost to do anything and I searched dozens of pages of forums. But anyway, as soon as I started following your instructions I knew it was going to work. It was so explicit and worked perfectly, and now I have apache and php on vista. YEAH!!!!

  64. Seems like most have configured PHP , but like most again, I am having trouble to have php work with mysql on vista under apache. PHP runs fine so far but cant connect to sql. What are the variables that need to be changed or added in php.ini anyone?

  65. SOLUTION TO MYSQL integration

    Ok, for all of you stuck on mySql: If you have configured php to work with above help and if you are having proble to get mysql running and if you get error msg that corresponds to something like not able to load php_mysql.dll >>
    first of all you have to enable
    extension_dir = “Your php dir\ext”
    and make sure you have
    extension = php_mysql.dll in php.ini file
    This should have been done already if you followed the instruction above.

    11. Right-Click on Start > Computer. Choose “Properties”, then “Advanced”. Click on “Environment Variables”. Click on PATH, then Edit… and add “;C:\php;c:\php\ext” (without quotes) to the end of the variable.

    now as instructed above, if you already added evironmental variable as phprc value “c:\php dir” (wherever your php dir is)
    in the list look for
    path=c:windows; c:\windows\system32;….
    lilight it and chose ‘edit’ and add at the end of the list the same value that you added for phprc (above)
    just make sure you add ; before “c\php dir”

    path=c:windows; c:\windows\system32;….
    path=c:windows; c:\windows\system32;c:\php

    this should work just fine.

    And I don’t think you have to add the path c:\php\ext in the environmental variable, just the path to the php folder should be enough.
    World is a happy place after all, specially when your mysqlstarts working. hmm time for a drink 🙂

  66. Thanks a lot. This is very helpful.

  67. You made my day 🙂

  68. Thanks a lot for such a nice step by step instructions.

    I could not get PHP started for a while, although I had the file C:\php\php5apache2_2.dll at the right location. Changed the permissions still did not help.

    Finally when i changed my httpd.conf to C:\php\php5apache2.dll instead of _2 thing then it worked. (upto test.php – yet to upload my complete application though)

    fyi – I have php5.2.5

  69. thanks man, great tutorial.
    would be really nice if we could have one for mysql as well.

  70. Perfect, First Time! Great instructions for installing Apache and PHP on Vista HP!

  71. Wow! It works!!
    Bought a book on PHP and MySQL today, fell at the first hurdle…thank you for making this easier, and letting me continue on my web developing journey! 🙂

  72. Thank you! Worked perfectly.

  73. Guys why not just used XAMPP. This is a very light way tool that can be installed with the click of a button. It is bundle up with Apache,perl,php,mysql,phpmyadmin. great tool check it out!

  74. Thanks a lot!
    After a hard day I discovered your procedure. Amazing, it works. Now PHP is integrated with Apache, and work fine under Vista Home Basic. Your tutorial is a great thing.

  75. Hey thanx that really works i have been trying all day to get apache and php working on vista ^^ next is to get my sql :s. thanx alot

  76. You Guys are rock! After reqding your above tips got the success to install the PHP on the Vista!


  77. You Guys are rock! After reading your above tips got the success to install the PHP on the Vista!


  78. As others have reported, I also get a 404 Not Found Error when trying to access the test.php file via http://localhost/test.php, which is within /htdocs/.

    I cannot find a solution or cause to this issue. Any advice really appriciated!!! Thanks for the steps.

  79. Thank you for this post. I generally work on Linux, but for reasons I’ll not bore everyone with, had to install the AMP part of LAMP on my windows install on the laptop. Everything worked smoothly except the PHP installer, which refused to work, and I seemed to only worsen it. This worked perfectly the first time though.


  80. Do I really have to disconnect from the internet?

  81. Thank you for your step by step explanation on how to get php and apache server. Really appreciate!

  82. Vista/IIS7/PHP/MySQL

    I can’t get SESSION variables to work. Is this a permissions problem? The same code works fine on the Linux server and in XP, so I know it is a Vista issue.

    [I know I am using IIS7 rather than Apache, but this is the best thread I have found, so ‘thanks’]

  83. I just like the tutorial and my blank page appeared, then changed the last line of item 12 and functioned properly. Tutorial Great, thanks.

    In item 12
    change PHPIniDir “C:\php” for PHPIniDir “C:\php\”

  84. Hmm, can’t seem to get mysql working…

    I’ve got the environment variables set as:

    And the ext_directory is set to:
    extension_dir = “C:\php\ext”

    I’ve tried adding the slashes as backslashes and forward slashes, as well as adding one at the end, no go…

    And yes, in that folder is the proper dll:

    Still getting:
    No MySQL extension

    Help…. Please… 🙂


  85. Man, a year after this was posted and this is *STILL* a lifesaver. THANK YOU SO MUCH for posting this and keeping this around. 2am on a Sat night and if I had any hair left it’d have been gone…

  86. Hi
    I have a problem after installing MySQL.
    It gives me a error message in command prompt-

    ERROR 2003: Can’t connect to MySQL server on ‘localhost’

  87. I get a 404 Not Found Error when trying to access the test.php file via http://localhost/test.php, which is within /htdocs/.

    I cannot find a solution or cause to this issue. Any advice really appriciated!!! Thanks for the steps.

  88. Thanks so much ! It worked perfectly. I especially appreciate the vista tips – man is that stuff counterintuitive.

  89. This is fantastic. You are fantastic.

  90. Ray if you still have problem with mysql connection check if the php.ini is valid (I had upload_tmp_dir =|c:/php/upload” instead of upload_tmp_dir =”c:/php/upload”)

    Good luck!

  91. Hey,
    thanks. I was really struggling to get that working.

  92. Hi,

    I have a problem displaying anything within the

    tags. I did everything you said, and have Apache running on Vista, and localhost/test shows the panels to demonstrate PHP is installed, but when I create a trial file, with the following code

    Agent: So who do you think you are, anyhow?

    and save this in the root directory C:\Apache Software Foundation\Apache2.2\htdocs\ as a .php file, when i browse to the file and open, nothing within the php tags, nor the tags themselves, displays. I have tried this with IE7 and Mozilla and had the same result.. any suggestions?

  93. hm seems i stuffed the above, i meant within the ?php … php tags, and the code was as follows with the > elements removed

    head /head

    Agent: So who do you think you are, anyhow?

    // print output
    echo ‘Neo: I am Neo, but my people call me The One.’;


  94. Hi,

    I am stucked at a point..
    all is I have installed the php,mysql,apache on my Vista home premium. all is working well but I want to change the path of the default php working folder.
    what I did is just commented the default path and include new path in the httpd.conf (in apache/conf) file as below.

    # DocumentRoot: The directory out of which you will serve your
    # documents. By default, all requests are taken from this directory, but
    # symbolic links and aliases may be used to point to other locations.
    #DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/htdocs”

    DocumentRoot “X:/php_project”

    (X: is partition on my laptop)

    I am not able to get the pages working here.
    can anybody give the solution??

  95. Hi…
    I tried for two days to install. I did every thing except copying the below lines in the apache config.
    this information helped me.

    LoadModule php5_module “C:\php\php5apache2_2.dll”
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir “C:\php”

    Now I could able to install.
    Thank’s for the the help.


  96. Hi,

    Thanks for the guide. It’s nice.

    But I am having problem with mysql_connect()…I followed the instruction.

    Still it’s not working.

    I using windows vista. Any help/solutions??


  97. Gloomy tales xxx tube ksi

  98. Thanks for this article! Vista is like a demon when trying to install PHP! Have bookmarked this page and saved it to file for future reference!

  99. hi i’m trying to configure a vamp but theres a problem that i encounter i cannot save my work in C:/windows/driver/etc/hosts
    the error pup ups that the file that i change cannot save at this file

  100. Very interesting tale www pichunter 😯

  101. perfect design thanks porntube videos 19412

  102. this post is fantastic free streaming porntv 1892

  103. Ok, I followed through every step on here and cannot seem to figure out my issue. I have successfully loaded apache 2.2.9 and PHP 5.2.6 The Apache Service Monitor shows on the bottom that both are running. Here is my issue

    When I go to my test page which is phpinfo.php the file trys to download. To at least see see the phpinfo(); results I added it to the body of the base index.html that comes with apache. Thre result is that the “It works!” part of the html displays, but not the PHP. Anybody have any suggestions. I have no errors and checked my paths both in the php.ini and httpd.conf and everything seems correct, I am getting no errors. I did try to change the php loadmodule command to use php5apache2.dll instead of php5apache2_2.dll and it made apache error and not load. Also I have shut off UAC to make sure there were no permission issues.

    Any suggestions would be helpfull, I am getting frustrated

  104. After all the checking and rechecking you think you are going mad. Here is what my issue was. After I posted the message I went back through step by step verifying each entry letter by letter and wouldn’t you know I had the following in my httpd.conf

    AddType application/x-http-php .php

    Instead of

    AddType application/x-httpd-php .php

    One little letter off and it did not work and no errors. Added the d to http and everything worked like a charm. Always pays to check entries letter by letter.

    Thanks again for the post it helped everything except my typing. ;>)

  105. If you encountered no noticeable errors during the build process but you are not
    seeing the appropriate output, it may be due to one or more of the following reasons:

    • Changes made to Apache’s configuration file do not take effect until it has been
    restarted. Therefore, be sure to restart Apache after adding the necessary PHPspecific
    lines to the httpd.conf file.
    • When you modify the Apache configuration file, you may accidentally introduce
    an invalid character, causing Apache to fail upon an attempt to restart. If
    Apache will not start, go back and review your changes.
    • Verify that the file ends in the PHP-specific extension as specified in the
    httpd.conf file. For example, if you’ve defined only .php as the recognizable
    extension, don’t try to embed PHP code in an .html file.
    • Make sure that you’ve delimited the PHP code within the file. Neglecting to do
    this will cause the code to output to the browser.
    • You’ve created a file named index.php and are trying unsuccessfully to call it as
    you would a default directory index. Remember that by default, Apache only
    recognizes index.html in this fashion. Therefore, you need to add index.php to
    Apache’s DirectoryIndex directive.
    • If you’re running IIS, make sure the appropriate mapping is available, as shown
    in Figure 2-2. If not, something went awry during the FastCGI installation process.
    Try removing that mapping and installing FastCGI anew.

  106. Hey, installed Apache and PHP but when want type localhost/test.php in my browser, it says “The requested URL /test.php was not found on this server.” Why is it so? Hope you can help me ^^ Thanks.

  107. I install everything but I still can’t run test.php
    This is the error:

    The requested URL /test.php was not found on this server.

    Also I would like to know where in httpd.conf I should type folowing lines :

    LoadModule php5_module “C:\php\php5apache2_2.dll”
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir “C:\php”

    Becouse I don’t have C:\php folder
    My php folder is in C:\wamp\bin


  108. Was having trouble installing Apache and then PHP on to Vista SP1. This worked perfectly! Thanks heaps!

  109. thxs alot for the tutorial, never got installing php problem in every platform except vista. too many time lost to find the problem. once again thxs!!

  110. Super !
    after two days i got it running 🙂
    You rule !
    Vsaka čast, še enkrat hvala.

  111. Hi , i tried all ways which is used step by stpe but still i can’t test test.php file ..
    Error :
    The webpage cannot be found
    HTTP 404
    Most likely causes:
    There might be a typing error in the address.
    If you clicked on a link, it may be out of date.

    What you can try:
    Retype the address.

    Go back to the previous page.

    Go to and look for the information you want.

    More information

    This error (HTTP 404 Not Found) means that Internet Explorer was able to connect to the website, but the page you wanted was not found. It’s possible that the webpage is temporarily unavailable. Alternatively, the website might have changed or removed the webpage.

    For more information about HTTP errors, see Help.

    any one help me ? why i am getting this error still..
    I used below these two s/w’s are installed on my vista Os
    1: apache_2.2.11-win32-x86-no_ssl
    2: php-5.2.8-Win32

    Apache is working fine .. but PHP not working .
    conf file has been editted as per posted steps .
    is still i need to add any thing to get this thing come end ?

  112. hi friends,,
    now its working .. really super site ,,, small error in file name, thats why its was not worked ..
    test.php.txt this is the error..
    i corrected after long searching … test.php ..
    this is rally my mistake .. but this site is really superb ..

    thanks to all ..

  113. Dude, you saved my life. I’ve spent the last four days looking for a site to help me install this onto my laptop.

    Very good job.

  114. For those who are receiving the ERROR 404 File not Found when you are testing PHP for the first time with the “test.php”. Make sure when you create the file in Notepad that you do the following:

    A) Open Notepad Start -> Accessories -> Notepad.
    B) Type
    C) Save As “All files” (ie: NOT TEXT FILE!)
    D) Explicitly give it the php extension “test.php”

  115. DAMMIT! Why didn’t I scroll all way down and read Bala’s comment! That would’ve saved me an hour of frustration and I wouldn’t have repeated him. DAAMIT!

  116. Hi,
    Use WAMP Server
    Automatically install all necessary application!!

    Trust me, I have Checked few of PHP local servers and
    came to conclusion that WAMP Server IS the best out there.
    Easy to install, Intuitive to work with.

    Great software for all PHP developers out there.

    If you using Skype while working on developing
    Make sure to start WHAP before Skype (and not the other way around).
    That the only “bug” I have found.

    Strongly recommend to use it!

  117. I was able to run the installer in Vista 64, home premium, after following your steps to “turn off user access control” and then start the console as the administrator.

    Within the console, I could run the installer command:

    msiexec.exe /i php-VERSION-win32-install.msi

    which seemed to do the right thing.

  118. THANK YOU SO MUCH. This was such a help.

  119. Please let me know if there are any equally great sites like this you can recommend to me. Thanks Again

  120. I dont think WAMP is good to use, i prefer to do manually. It is much better and not that complicated

  121. Thank you so much! I have been struggling all day-using a book that I actually paid good money for. Your free advice was so much more useful!

  122. This is the error:
    “Not Found
    The requested URL /AirAlliance/web/AirAllience/index.php was not found on this server.”

    I was trying to run the sample, I’ve already set up the apache server and it says “It works”, now, i was trying to run the php info and an error message occured says, “Forbidden” or 403, or sometimes 404, please tell me what to do? i want to pulled my hair in my head, almost 2 nights that i am very frustrated…

  123. Hi

    Thanks very much for the tutorial. I used your tutorial on apache to install apache and managed to get it running. I have used your php tutorial to try and install php.

    When I try to load the http://localhost/test.php it asks me if I want to open the file or save it. I chose to open it and it shows me the php info code you told us to type in.

    Could you please suggest what I could have done wrong.

    It is my first time installing php as I have just decided to start learning php.
    Thanks very much



    • Hi even i get de code tat u asked to type.. wat shud i do now?

  124. Iam badly in need of ur help…pls help me out na.. thanks a lot in advance.

  125. Problems I had (I think 1 and 2 came from having a different .msi file than when you made the instructions and 3 just needs clarification for people like me):
    1. I could not find all the dll’s you listed (I am going with the the included in the msi for the moment.

    2. I did not have the file php.ini-recommended so I left the php.ini that was already there.

    3. I was not sure where to put the 4 lines:
    LoadModule php5_module “C:\php\php5apache2_2.dll”
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir “C:\php”
    So I put the LoadModule at the end of the LoadModule statements; the AddType at the end of the AddType statements; and the other two lines at the very bottom.

    4. AND THE BIGGEST PROBLEM — MS’s notepad appended .txt to test.php so it was test.php.txt and I spent 4 hours trying to figure out why everything seemed to look like it was working except I kept getting a 404. I dropped the .txt suffix and it worked as described.

    Now to do my homework and hopefully get good file access. But that is another problem.

  126. I have followed this tutorial, but i got to place that i can’t find the PHP 5.2.3, i spent almost three days trying to firuge something out with PHP4 but never worked out.
    I have installed Php 5.3.10 with apache2.2 and mysql and evrything work well.
    all the confuguration went okay, i tred test.php and it worked well, but when i upload my website that i have done it on window Xp, i couldn’t connect to mysql when i hit connect on the webpage it gives me the http404 error, does anyone had this problem.
    i was serching the net, i have a feeling that this is caused because i am using vista ultimate, so the code i different from php4.
    code difference

    i hope i will be able to fix, so i can continue doing my website.

  127. it works!!!!!!!!!!!!!!!!!!!!! Thanks a lot!!!!

  128. Thank you so much for this excellent and effective solution. I’ve been struggling with this installation on and off for a few days now, and your solution got me up and running. You Rock!

  129. Thank you, really useful information!

  130. I am having very little luck with this- followed your instructions but apache won’t load the php module. The debug says that “php5apache2_2.dll” isn’t loading, and a quick check reveals that no such file is in the php folder! I have downloaded the most recent stable version, so why is this? Any help greatly appreciated!

    • Thanks!!!!!!!!

      I tried install php this weekend, then following your instructions this work!!!!!

      I not wanted install combo php+apache+mysql, i wanted install each one, then i found your help…


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: