-   Linux - Server (
-   -   Help. Apache doesn't read PHP files (

Maeltor 09-20-2006 11:53 AM

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:

[Tue Sep 19 19:05:51 2006] [error] [client] Directory index forbidden by Options directive: /srv/www/htdocs/
Here is the virtual host configuration for that particular server and VHOST:

<VirtualHost *:80>
 DocumentRoot /srv/www/htdocs
      <Directory /srv/www/htdocs>
  order allow,deny
  allow from
  allow from

I don't see an Options directive. I do have an options directive in the default server config above the Vhosts config

<Directory />
    Options None
    AllowOverride None
order allow,deny
allow from

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/

LoadModule php5_module                    /usr/lib/apache2/
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:

application/x-php php php3 php4

w3bd3vil 09-20-2006 02:03 PM

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


AddType application/x-httpd-php .php

Maeltor 09-20-2006 03:30 PM

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?

Maeltor 09-20-2006 03:35 PM

Looks like that did the trick. Thanks for the help!

All times are GMT -5. The time now is 04:53 AM.