PHP4 not working on new RedHat 7.2 install

PHP4 not working on new RedHat 7.2 install

Post by Derek Hardim » Sat, 05 Jan 2002 02:25:30



I've just installed RH7.2 with everything on a clean machine. PHP4 is
installed but when I create a simple test.php like this...

<html>
<body>
<?php
echo "Hello"
?>
</body>
</html>

...the source gets displayed instead of the intended result in a
browser. Any ideas what I'm doing wrong anyone.

Regards,
   Derek

 
 
 

PHP4 not working on new RedHat 7.2 install

Post by mike » Sat, 05 Jan 2002 03:19:04


just dealt with this after a 7.1 install

make sure you have /etc/httpd/modules/libphp4.so

check /etc/httpd/conf/httpd.conf :

# find a bunch of LoadModule stmnts
#<IfDefine HAVE_PHP4>    i commented this stuff out. or just define
HAVE_PHP4
LoadModule php4_module        modules/libphp4.so
#</IfDefine>

#AddModule stmnts
#<IfDefine HAVE_PHP4>
AddModule mod_php4.c
#</IfDefine>

#add Option ExecCGI to directories where the php file will be
<Directory "/var/www/html">
    Options Indexes Includes FollowSymLinks ExecCGI

    #you'll need to make sure you can POST
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>

</Directory>

#tell Apache to treat php files as scripts -- you'll see this towards the
end of the file.
<IfModule mod_php4.c>
  AddType application/x-httpd-php .php4 .php3 .phtml .php
  AddType application/x-httpd-php-source .phps
</IfModule>

that got me going. Good luck if you try mod_auth_mysql   'cause yer httpd
probably wasn't compiled with that option. Your echo program will work but
php will be pretty lame if httpd can't connect to a database. i think db and
dbi are the only options compiled in with a normal RedHat install.

hope this helped. let me know if you ever have any luck with mysql.

see ya,
mike


Quote:> I've just installed RH7.2 with everything on a clean machine. PHP4 is
> installed but when I create a simple test.php like this...

> <html>
> <body>
> <?php
> echo "Hello"
> ?>
> </body>
> </html>

> ...the source gets displayed instead of the intended result in a
> browser. Any ideas what I'm doing wrong anyone.

> Regards,
>    Derek