Cocoa Dev
Cocoa Dev

Reputation: 9541

PHP page doesn't load. Instead it gives me a 404 error

The title describes the question.

I have PHP installed, Apache, MySQL and also phpMyAdmin in the htdocs folder of Apache. I installed them separately and do not use a compilation package. I did try to create a php file with phpinfo

<?php
 phpinfo();
?>

Saved the file as phpinfo.php

When going to

http://localhost

I see the phpinfo.php file listed. When I click the phpinfo.php file

I get a 404 error. There are no other files listed in the root http folder except one (phpinfo.php)

PHP was installed and php short tags are enabled

short_open_tag = On

I am not sure if it's a capital On or on

Note: I used http://www.jesterwebster.com/setting-up-a-test-bench-web-server-with-apache-php-mysql-and-more-on-windows/26 as a guide for my Apache and PHP install

I opened the error log and I found something disturbing. Not sure how to fix it

[Fri Aug 03 13:07:34 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/
[Fri Aug 03 13:09:33 2012] [error] [client 127.0.0.1] File does not exist: C:/website/example/online/Program Files, referer: http://localhost/

Upvotes: 0

Views: 6651

Answers (2)

Dean Grell
Dean Grell

Reputation: 143

Per your error logs, your DocumentRoot "C:/websites/example/online" is websiteS, your error log is looking for website without the s.

Upvotes: 2

Hanky Panky
Hanky Panky

Reputation: 46910

Have you confirmed from apache configuration file that PHP is enabled and is configured correctly to work with apache? And has the apache server been restarted after configuration? Also Try adding an html file in the htdocs directory to confirm if the directory is correct.

Edit: Also you mentioned that error log is looking for your file in this directory C:/website/example/online/Program Files

But you mentioned that you placed phpinfo.php in htdocs folder for apache. There might be an issue related to difference between those two paths

Upvotes: 0

Related Questions