It seems to make no difference to the problem whether that line is in or out, however I have removed it. Thanks for spotting it. The problem is as if Apache is just not functioning as a server. Yet the confirmation Apache page appears when I test it.
In I.E or Mozilla when I enter http://localhost/phpinfo.php (or any other php file taken from one of my websites) I get a '404 page not found'. If I use File, Open on either browser and navigate to C:\Apache\htdocs, I can load an html file from there but not a PHP file.

Regards

Awestruck

    If you create a new HTML file (called new.html for example) in c:\Apache\htdocs\ can you successfully view it at http://localhost/new.html ?

    Since you're using Windows, are you viewing file extensions? To verify that you are, open My Computer, go to Tools->Folder Options, click the View tab, and make sure that the checkbox for "Hide file extensions for known file types" is unchecked. If it was checked, go back and make sure your PHP files weren't inadvertently named something like test.php.txt or something along those lines.

      File type is always visible on my machines as this is essential for my web design work. The new.html file showed up only if I used File Open in IE it would not show up if I usd the address bar and http://localhost/new.html
      None of the PHP files in htdocs used for testing have extra file types tagged on the end.
      As I said in my previous reply, HTM amd HTML files show up if I load them in IE using 'File Open' but not if I use http://localhost/anyfile.html in the Address bar. I get a 404 message.
      PHP files will not show up by using either http://localhost/anyfile.php or by using IE, File, Open, then C:/Apache/htdocs/anyfile.php. This produces a download dialog box with Save or Open buttons.
      If I type http://local host in the address bar of either IE or Mozilla, the Apache's 'successful installation' page appears.

      Incidentally the line that you suggested I remove yesterday (mod_php5.c) I had entered because the text book PHP in easy steps instructed me to.
      As previously reported, I have removed it.

      Best regards

      Awestruck

        Awestruck wrote:

        As I said in my previous reply, HTM amd HTML files show up if I load them in IE using 'File Open'

        Well using Open from the File menu has nothing to do with using a webserver so that's really irrelevant.

        This may sound stupid, but I just want to cover everything; when you made the changes to Apache's .conf file, you did restart Apache afterwards, correct?

        Also, where is Apache's config file placed on your hard drive?

        EDIT: Hmm... Try doing this, just out of curiosity:

        cd c:\Apache\bin
        httpd -k stop
        httpd -k start -d "C:\Apache\htdocs"

        Then see if you can retrieve the HTML files.

        One last thing - are you sure it's a 404 Not Found error you're getting, and not a 403 Forbidden error?

          Hey guys,

          I am having a similar problem to Awestruck and I am a PHP/Apache newboy. When I try to view my test.php page in my root directory C:\htdocs\ and type http:// localhost/ into my address bar in IE7, it is showing'Internet Explorer cannot display the webpage'.
          I have the following code for the location of my root in httpd.conf...

          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:/htdocs/"

          #

          Each directory to which Apache has access can be configured with respect

          to which services and features are allowed and/or disabled in that

          directory (and its subdirectories).

          #

          First, we configure the "default" to be a very restrictive set of

          features.

          #
          <Directory />
          Options FollowSymLinks
          AllowOverride None
          Order deny,allow
          Deny from all
          Satisfy all
          </Directory>

          #

          Note that from this point forward you must specifically allow

          particular features to be enabled - so if something's not working as

          you might expect, make sure that you have specifically enabled it

          below.

          #

          #

          This should be changed to whatever you set DocumentRoot to.

          #
          <Directory "C:/htdocs/">

          Apache is running OK but when I add 'LoadModule php5_module c:/php5/php5apache.dll' it wont start.
          I don't want to add to the confusion but it seems like a similar problem to Awestruck's.
          Any help would be greatful and I am trying to fix it myself right now.

            Do you have apache 1, apache 2, apache 2.2?

            There a 3 dlls. One for each type.

            php5apache2.dll is for apache 2.

            The apache2.2 thing can also catch people out as unless things have changed needs another one.

            Have a look in event log in control panel under administrative tools as it is a bit more helpful for errors.

            Also try with no extensions to start with as they can cause issues with paths sometimes.

              I have Apache 2.2.4. The error Apache is showing is that it cannot locate php5apache2.dll in C:/php5/. It is there and I haven't done a typo as I have even tried copying and pasteing the title name just to be sure. I have just done another check and it is now showing that it cannot locate php5apache.dll in C:/php5/ and that is there as well!

              I have now put a # in front of '#LoadModule php5_module c:/php5/php5apache.dll and Apache is working OK but when I remove the # so the line is read it won't work. I am going to sleep on this on look at it on Sunday after a hard days MTB riding tomorrow!

                The error Apache is showing is that it cannot locate php5apache2.dll in C:/php5/.

                Ah, but for Apache 2.2.4 the correct dll is: php5apache2_2.dll

                  You are a star!! It now works! Problem solved!

                  Well, there are no problems at the moment and Apache is showing all service are running OK so it looks good. I saw php5apache2_2.dll and just thought it was an extra due to the underscore instead of a period... dohhh!

                  Maybe this will help Awestruck with his problem as I can let him have my httpd.conf file if he wants to check it.

                  I only joined this forum about 4 hours ago. It has took me all week to sort this problem out until I came here!

                  Thanks again!

                  Kevin Mawdsley

                    Interesting that I am not the only one suffering with this problem.
                    I only mentioned the 'Open from the File' comment to demonstrate that the files were definitely in the htdocs folder.
                    Yes I re-started after every change.
                    Apache's conf folder is in the C:\Apache folder.
                    The file httpd.conf is in the C:\Apache\conf folder
                    Definitely a 404 error not 403.

                    I tried the bit of code as suggested, after the Stop and Start bits it gave a message 'httpd' is not recognised as an...
                    also I could not retrieve the html files using IE.

                    best wishes

                    Awestruck

                      Awestruck - can you double check your config file? In your post, you had this:

                      LoadModule ph5-module c:/php/php5apache2.dll

                      Note that you're missing a 'p' on php5-module.

                        And if I'm not mistaken, it should be php5_module not php5-module...

                          Oh dear! I had high hopes that some of the many helpful suggestions might sort out my problem but they did not.
                          My Apache is version 2.0.43.0 so the php5apache2.dll in my 'conf' is the right file.
                          Also, the typo (i.e. no p in php) was in my post but not in my actual conf file. I suspect that my Apache installation
                          is corrupt even though its home page shows up when I type http://localhost in the address bar.
                          Thank you all for your patience and help, I think I will now give up hope of ever sorting the problem.

                          Best wishes

                          Awestruck
                          Visit my website www.colycomputerhelp.co.uk

                            whoops! I forgot to mention that the hyphen was also a typo in my post but is an underscore in my conf file. I did that post when I was very weary from severe tonsilitis and my battle with Apache.

                            Awestruck

                              You might want to copy and paste instead of retyping out stuff.

                              I suspect that my Apache installation
                              is corrupt even though its home page shows up when I type http://localhost in the address bar.

                              It might be a good idea to uninstall Apache and then reinstall it. If Apache does not work, PHP would not work either (except on the command line).

                                I guess you had your reasons but if there's no specific need to add your own modules etc why not use a WAMP bundle?
                                - even installing those can be painful but there's far less to configure
                                apache2triad is one of the less well known, but its excellent and installs cleanly and easily

                                  5 days later

                                  I've always recommended manually installing all components since a) it gives you more understand about how they work and how they are configured, and b) you would never, ever use one of those pre-packaged bundles in a production environment.

                                    8 days later

                                    Thank you for your help folks but I have now clicked the resolved link because I have resolved never to touch Apache and the PHP program again. Life is too short, I have spent over 100 hours battling with the most flaky programs of my 25 year career as a programmer and web designer. I have now reverted to viewing my PHP pages in Mozilla (which IE can't do) and I test my forms and page counters on the internet.
                                    Happy Christmas
                                    Awestruck

                                      Awestruck wrote:

                                      I have spent over 100 hours battling with the most flaky programs of my 25 year career as a programmer and web designer.

                                      Odd... I've seen plenty of programmers/web designers with little to no experience (me being one of them in the beginning) use the same applications... perhaps you're right and they are 'flaky' though. shrug

                                        a year later
                                        bradgrafelman;10836078 wrote:

                                        If you create a new HTML file (called new.html for example) in c:\Apache\htdocs\ can you successfully view it at http://localhost/new.html ?

                                        Since you're using Windows, are you viewing file extensions? To verify that you are, open My Computer, go to Tools->Folder Options, click the View tab, and make sure that the checkbox for "Hide file extensions for known file types" is unchecked. If it was checked, go back and make sure your PHP files weren't inadvertently named something like test.php.txt or something along those lines.

                                        Thanks a lot.
                                        It worked.

                                          Write a Reply...