LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-20-2006, 10:53 AM   #1
Maeltor
Member
 
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69

Rep: Reputation: 15
Help. Apache doesn't read PHP files


Hi everyone,

Yesterday my apache 2 webserver stopped serving PHP files. If I try to access a directory that has index.php as its index, all i get is a 403 Access Forbidden! If i try to read from the php file directly, my browser just wants to download the file.

Nothing changed from what I can see:

Here is the entry in my log:
Code:
[Tue Sep 19 19:05:51 2006] [error] [client 66.213.158.39] Directory index forbidden by Options directive: /srv/www/htdocs/
Here is the virtual host configuration for that particular server and VHOST:
Code:
# NAME DEFAULT NULL
<VirtualHost *:80>
 DocumentRoot /srv/www/htdocs
 ServerName netcentralinc.net
       <Directory /srv/www/htdocs>
   order allow,deny
   allow from 66.213.158.32/255.255.255.224
   allow from 66.213.128.18
        </Directory>
</VirtualHost>
I don't see an Options directive. I do have an options directive in the default server config above the Vhosts config
Code:
<Directory />
    Options None
    AllowOverride None
order allow,deny
allow from 66.213.158.32/255.255.255.224
</Directory>
I'm sure the Options NONE is throwing off the error. If i change it to all it works but all i get is a directory listing, the server still doesn't parse index.php. I've tried throwing a default ()phpinfo page in a vhost that I know works as index.php and when I do I get the same 403 forbidden or directory listing.

I have mod_php5 installed.
Here is the line in /etc/apache2/sysconfig.d/
Code:
LoadModule php5_module                    /usr/lib/apache2/mod_php5.so
I am running apache2-prefork so should it be in /usr/lib/apache2-prefork? If so why did it work fine up until now.

I have the following line in mime.types which is just a symbolic link to /etc/mime.types:
Code:
application/x-php php php3 php4
 
Old 09-20-2006, 01:03 PM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,191

Rep: Reputation: 49
you get a forbidden because you dont have a index file and apache doesnt wants to list all the contents of the dir.
this what is in my httpd.conf, try it

Quote:
AddType application/x-httpd-php .php
 
Old 09-20-2006, 02:30 PM   #3
Maeltor
Member
 
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69

Original Poster
Rep: Reputation: 15
Hi w3bd3vil,

Thanks for the reply. Do i put that in the main mime.types or directly in the Apache httpd.conf?

Also if its in the apache httpd.conf file, does it go in the virtual host config or in the main conf?
 
Old 09-20-2006, 02:35 PM   #4
Maeltor
Member
 
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69

Original Poster
Rep: Reputation: 15
Looks like that did the trick. Thanks for the help!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache 2, PHP 5, SuSE 9.2 - cannot run php files dickohead Linux - Networking 6 06-28-2006 10:25 AM
Firefox won't read .php files Lagg Linux - Software 1 05-06-2005 12:40 AM
Set up Apache to read php IN html code? WorldBuilder Linux - Networking 10 01-27-2004 12:16 PM
read php files, redhat 8.0 lenlutz Linux - Software 8 10-21-2003 12:20 PM
PHP unable to read .php files tuka Linux - Software 6 10-12-2003 06:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration