apache2 php4 - browser showing source ??

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I downloaded a GUI for nagios that uses PHP but when I point the
browser at the PHP file, it shows me the source of .php file instead of
executing it,

if i use command line 'php filname.php' then I see exepected result but
why can I not do that via web??

# /usr/local/bin/php -v
PHP 4.4.0 (cli) (built: Jul 21 2005 11:55:49)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

# /usr/local/apache2/bin/httpd -v
Server version: Apache/2.0.53
Server built:   Apr 11 2005 15:38:12

# grep php /usr/local/apache2/conf/httpd.conf
LoadModule php4_module        modules/libphp4.so
DirectoryIndex index.html index.html.var index.php
AddHandler php4-script php
AddType text/html  php
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
<Files ~ "\.(cgi|shtml|phtml|php?)$">

# grep -i scriptalias /usr/local/apache2/conf/httpd.conf
ScriptAlias /nagiosweb /usr/local/apache2/htdocs/nagiosweb/nagiosweb

# ls -l /usr/local/lib/php.ini
-rw-r--r--   1 root     other      39485 Jul 28 12:24

# ls -l /usr/local/apache2/modules/libphp4.so
-rwxr-xr-x   1 webusr   webusr   11798444 Jul 28 12:18

Re: apache2 php4 - browser showing source ??

On 28 Jul 2005 10:52:09 -0700, news8080@yahoo.com wrote:

Quoted text here. Click to load it

 You've got three conflicting settings here - is php text/html,
application/x-httpd-php, or handled by php4-script?

 The final one is the typical one for PHP an Apache module (the usual and
recommended config). I'd remove the others, although since this is the output
of grep it's out of context so it depends on what else is in that configuration

<http://www.andyhsoftware.co.uk/space Space: disk usage analysis tool

Site Timeline