Jump to content

trying to set apache to work as web server with php


sandipjoshi

Recommended Posts

Hi All,

wonder if someone can help me please.

I have installed apache 2.2.4 and php 5.2.1

 

I am using windows 2000.

 

I am trying to figure out what url to use so that apache is being used as a web server.

 

I have created a test php file and placed it in the followign location on my machine:

 

C:\Program Files\Apache Group\Apache2\htdocs

 

the document root in the httpd config file is:

 

DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs"

 

and my directory path is set to:

 

<Directory "C:\Program Files\Apache Group\Apache2\htdocs">

 

the contents of my test php file is:

 

<html>
<head>
</head>
<body>


<?php phpinfo(); ?>
</body>
</html>

 

if I type:

 

http://localhost into Internet explorer I get the standard "It Works" message.

 

I have been typing:

 

http://localhost/test.php and I get a page cannot be displayed message.

 

Can someone tell me what path I should be tying in the URL to view my pages?

Link to comment
Share on other sites

What you've typed seems to be a correct configuration. A way you could troubleshoot this is by turning on indexes for that directory and deleting the index file. Apache will then default to showing you a list of files in that directory.

 

If test.php is listed, you will be able to click on it and view. Any errors then given would be an apache security mis-config. If test.php is not listed then it is a documentroot problem. Even if you do not have PHP and Apache appropriately configured to parse the PHP, you should still see the files.

 

Good Luck.

Link to comment
Share on other sites

Yes once Apache is installed, delete the files already in the htdocs folder no need for them now. Once you have done that go to http://localhost and you should now get a list of files/folders that is the document root (htdocs folder).

 

Is you test.php file listed.

 

Also could you tell me the process you did to create the test.php file? If you used Notepad to create it make sure when you went to save it you did not save it as test.php.txt. Notepad will by default add a .txt file extension when you save. What you should do before you click the save button is to make sure the File Type box is set to All Files and not Text Document.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.