471,579 Members | 1,323 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,579 software developers and data experts.

apache2 php4 - browser showing source ??

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
1 3523
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.

Similar topics

reply views Thread by Aldo Polli | last post: by
1 post views Thread by Chris Haynes | last post: by
6 posts views Thread by Greg Bryant | last post: by
1 post views Thread by FL | last post: by
5 posts views Thread by Ad Astra | last post: by
3 posts views Thread by masterx | last post: by
1 post views Thread by nsteele84 | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
1 post views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.