LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Help. Apache doesn't read PHP files (http://www.linuxquestions.org/questions/linux-server-73/help-apache-doesnt-read-php-files-485332/)

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:
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

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

Quote:

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 05:20 PM.