[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Can't get PHP working - RH9, PHP4, Apache 2



Scott Sherratt wrote:

I'm trying to get PHP running on my RH9 system, but
can't seem to get it to work.   My test php program
results in a blank browser screen (though I can see
the source), and it runs fine on at a 'hosted' site
that uses RH.  When I issue php -i > tempout.html at
the command line, I get a nice HTML file.

I understand that PHP should work without having to
compile source code.  Is there anything else I need to
configure ?

Basically I installed the RPM's, confirmed that
/etc/httpd/conf.d/php.conf contains:

####################################
# PHP is an HTML-embedded scripting language which
attempts to make it
# easy for developers to write dynamically generated
webpages.
#

LoadModule php4_module modules/libphp4.so

#
# Cause the PHP interpreter handle files with a .php
extension.
#
<Files *.php>
   SetOutputFilter PHP
   SetInputFilter PHP
   LimitRequestBody 524288
</Files>

#
# Add index.php to the list of files that will be
served as directory
# indexes.
#
DirectoryIndex index.php

####################################

Here are the RPM's that are installed:

[root srv root]# rpm -qa | grep php
php-imap-4.2.2-17.2
php-mysql-4.2.2-17.2
php-pgsql-4.2.2-17.2
php-4.2.2-17.2
php-ldap-4.2.2-17.2
php-devel-4.2.2-17.2
[root srv root]# rpm -qa | grep httpd
httpd-manual-2.0.40-21.5
redhat-config-httpd-1.0.1-18
httpd-2.0.40-21.5
[root srv root]# httpd -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c

Test PHP script in /var/www/html/temp.php

<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY>
<?
/*
* Print Info
*/
phpinfo();
?>
</BODY>
</HTML>

There is nothing unusual in /var/log/messages, or
/etc/httpd/logs/error_log.  Syntax check of httpd.conf
returns OK.

Again, what else do I need to do in order to get PHP
running under RH9 & Apache 2 (other than uninstalling
RPM's and complining everything from source).  I'm
pulling my hair out!

Scott,

It should work without compiling, it does here. I notice that you have a short opening tag "<?", which will only work if you have "short_open_tag = On" in /etc/php.ini. When installing RH9 I did an install of everything so besides the rpms you quote, I also have:
php-odbc-4.2.2-17.2
asp2php-0.76.2-5
php-manual-4.2.2-17.2
php-snmp-4.2.2-17.2
asp2php-gtk-0.76.2-5
though I don't think these should make a difference. I assume your /etc/httpd/conf/httpd.conf has the:
Include conf.d/*.conf
line so that your /etc/httpd/conf.d/php.conf is included. The command line "php -i >..." test you did will use the standalone executable and not the Apache module so it will not help.


Let us know how it goes. Hoping this helps.

Chris




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]