PHP configuration 'file not found'

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mitchy1111
Forum Newbie
Posts: 1
Joined: Sat May 17, 2008 4:56 am

PHP configuration 'file not found'

Post by mitchy1111 »

Hello,

I am just trying to setup PHP 5.2.6 to run with apache 2.0.63. I beleive I have added all the details I should have to the configuration files, but when I try to load a .php file through my browser it says file not found. Using win XP home sp2, IE7

e.g. my doc root is C:\webs\test. I have a file in this directory called index.php

if I enter http:\\localhost in my browser it says file not found.
if i enter http:\\localhost\index.php it says file not found

If I change the filename from index.php to index.htm, the browser displays an index with a list of the files in the document root (only index.htm at present but if I add more they are listed also). If I click on the file in the list it displays the htm file.

any ideas?

Thanks
Martin
Dutchben
Forum Newbie
Posts: 12
Joined: Wed May 14, 2008 10:19 am

Re: PHP configuration 'file not found'

Post by Dutchben »

It looks to me that Apache is not set up to parse php files yet. Make sure that in your httpd.conf file you have a line similar to this

LoadModule php5_module "<path to php>"
Which tells Apache to load php

and a line like this

AddType application/x-httpd-php .php
That tells Apache to parse .php files.

Otherwise Apache will not do anything when you request a .php file
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: PHP configuration 'file not found'

Post by VladSun »

Dutchben wrote:It looks to me that Apache is not set up to parse php files yet. Make sure that in your httpd.conf file you have a line similar to this

LoadModule php5_module "<path to php>"
Which tells Apache to load php

and a line like this

AddType application/x-httpd-php .php
That tells Apache to parse .php files.

Otherwise Apache will not do anything when you request a .php file
I'm in doubt that would be the reason ...
@mitchy1111 - anything weird in your configs- i.e. custom rewrite_url rules, .htaccess files, etc. ?
Anything in your error logs?
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply