Pesho Posted July 7, 2007 Share Posted July 7, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/58816-error-404-not-found/ Share on other sites More sharing options...
wildteen88 Posted July 7, 2007 Share Posted July 7, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/58816-error-404-not-found/#findComment-291828 Share on other sites More sharing options...
Pesho Posted July 7, 2007 Author Share Posted July 7, 2007 thank you! actually the file was test.php.txt, grrrrrrr. Best, pesho Quote Link to comment https://forums.phpfreaks.com/topic/58816-error-404-not-found/#findComment-291842 Share on other sites More sharing options...
wildteen88 Posted July 7, 2007 Share Posted July 7, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/58816-error-404-not-found/#findComment-291925 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.