Jump to content

Error 404: Not Found


Recommended Posts

Hi all,

 

I get the following error when trying to run a test.php file:

 

Not Found

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

 

 

the test.php file is in the htdocs directory in apache.

 

I have PHP 5 installed and I've added the following to the httpd.conf file:

 

DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"

PHPIniDir "C:\\Program Files\\PHP\\"

LoadModule php5_module "C:\\Program Files\\PHP\\php5apache2_2.dll"

AddType application/x-httpd-php .php

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

 

Why doesn't it find the file test.php?

Any suggestion will be highly appreciated.

 

Best,

Pesho

Link to comment
Share on other sites

Have you restarted Apache so any changes you have made to httpd.conf (or the php.ini) can take affect.

 

Also what files are listed when you go to http://localhost/ - if no files is listed and you get the 'It Works' message remove any files already in the htdocs directory. Reload http://localhost/ you should see all files/folders in the htdocs folder listed.

 

Your httpd.conf configuration is fine. However for me I prefer to install Apache and PHP in C:/Server rather than the default installation path (C:/Program Files). This just helps to keep file paths short and simple.

Link to comment
Share on other sites

thank you!

 

actually the file was test.php.txt, grrrrrrr.

 

 

Best,

pesho

We all do it! If you are on windows I'd recommend you to disable a setting a called Hide extensions for known file types in Folder Options (Open amny folder > Tools menu > Folder Options > View Tab). That way when you view files in Windows Explorer you'll see the full filename, eg: filename.doc and not just filename.

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.