[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: can't serve php files in apache2



Zachary Uram wrote:
> emmanuel segura wrote:
> > if using apache2 look in -l /etc/apache2/mod-enable/*.conf
> 
> Adding "AddType application/x-httpd-php .php" to
> /etc/apache2/mods-available/php5.conf and restarting apache2 worked!
> Thanks :)

You shouldn't have needed to add it since the default is that it is
already configured there.  Perhaps the contents had become munged up
somehow?  In which case I recommend purging the package and
reinstalling to get a known good copy of the file.

Or possibly you don't have the mime-support package installed?  That
supplies /etc/mime.types which is included into apache by the mime
module (which should also be enabled but might have been disabled).

  $ grep TypesConfig /etc/apache2/mods-enabled/mime.conf 
  TypesConfig /etc/mime.types

  $ grep php /etc/mime.types
  application/x-httpd-php                         phtml pht php
  application/x-httpd-php-source                  phps
  application/x-httpd-php3                        php3
  application/x-httpd-php3-preprocessed           php3p
  application/x-httpd-php4                        php4
  application/x-httpd-php5                        php5

Bob

The /etc/apache2/mods-available/php5.conf file from 5.3.3-2.

<IfModule mod_php5.c>
    <FilesMatch "\.ph(p3?|tml)$">
	SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
	SetHandler application/x-httpd-php-source
    </FilesMatch>
    # To re-enable php in user directories comment the following lines
    # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
    <IfModule mod_userdir.c>
        <Directory /home/*/public_html>
            php_admin_value engine Off
        </Directory>
    </IfModule>
</IfModule>

Attachment: signature.asc
Description: Digital signature


Reply to: