By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,282 Members | 1,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,282 IT Pros & Developers. It's quick & easy.

apache2 php4 - browser showing source ??

P: n/a
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
/usr/local/lib/php.ini

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

Jul 28 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 28 Jul 2005 10:52:09 -0700, ne******@yahoo.com wrote:
# 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


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
file.

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 28 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.