Mailinglist Archive: opensuse (5130 mails)

< Previous Next >
Configuring Apache for php on SuSE 9.3 Pro
  • From: peter <apvx95@xxxxxxxxxxxxx>
  • Date: Tue, 09 May 2006 22:25:19 +0100
  • Message-id: <446108BF.2040003@xxxxxxxxxxxxx>
Hi gurus

I'm trying to configure Apache to display php files.

Apache is installed OK and will display an html file in /srv/www/htdocs

I've installed mod_php4 from the SuSE installation CD and patched it via YaST2.

Following the instructions, I've made the following changes to config files:

/etc/apache2/conf.d/php4.conf
=============================

# Added by PB 09.05.2006

<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 9524288
</Files>

# End PB addition 09.15.2006

<IfModule sapi_apache2.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php
DirectoryIndex index.php3
DirectoryIndex index.php4
</IfModule>

/etc/sysconfig/apache2
======================
...
...

# Modified by PB 09.15.2006
# added php4.conf to include files

APACHE_CONF_INCLUDE_FILES="/etc/apache2/conf.d/php4.conf"

# End PB modification 09.05.2006
...
...

There are no changes to httpd.conf.

I've then restarted Apache (/usr/sbin/rcapache2 restart)

But Apache will not display php files from htdocs. Firefox says:

"You have chosen to open
index.php
which is a: PHP script
from: http://localhost

What should Firefox do with this file?
* Open with ...
* Save to disk
...
..."

So Apache clearly doesn't understand that it is to use mod_php for *.php files.

I've also looked at the HTTP Server settings in YaST and they all look OK to me (although I'm not an expert, as you can tell).

Anyone have any suggestions?

Thanks

Peter



< Previous Next >