Page 1 of 1

PHP not processing on RedHat 8.0

Posted: Sat Jan 11, 2003 5:16 pm
by Innova
I have a clean RedHat 8.0 install (I installed everything), and PHP doesn't seem to be handleing the .php files.

There is no mention of "php" anywhere in the httpd.conf file, in the past when I've installed PHP myself, I just uncommented the lines that referenced PHP. Anyone else have this problem with RedHat 8.0?

Here is more information:

httpd-2.0.40-11
php-4.2.2-8.0.5

There is a php.conf in /etc/httpd/conf.d, but no mention of php in /etc/httpd/conf/httpd.conf.

What else do I need to look for?

Posted: Sun Jan 12, 2003 2:57 am
by volka
the file list of that rpm shows that the php module should be installed in /usr/lib/httpd/modules/libphp4.so and that there should be a file /etc/httpd/conf.d/php.conf. Is there something like

Code: Select all

<IfDefine PHP4>
in your apache configuration?
When the apache process is started config.parameters may be passed to it.
E.g. at my gentoo-linux system there is a file /etc/conf.d/apache that contains the line

Code: Select all

APACHE_OPTS="-D PHP4"
that defines the symbol PHP4. Therefor all

Code: Select all

<IfDefine PHP4>
...
</IfDefine>
in the apache.conf will be executed. There are three of these block in my config. One for LoadModule, one for AddModule and one for including the extra-config file.

Hope this is useful for redhat, too ;)

Posted: Sun Jan 12, 2003 9:03 am
by Innova
/usr/lib/httpd/modules/libphp4.so is there.

I don't have IfDefine PHP4 anywhere in my /etc/httpd/conf/httpd.conf.

I also can't find APACHE_OPTS="-D PHP4" anywhere....

Posted: Sun Jan 12, 2003 9:16 am
by volka
then you may add it manually
  • search for the LoadModule entries in your httpd.conf
  • append LoadModule php4_module modules/libphp4.so
  • search the AddModule entries
  • apend AddModule mod_php4.c
  • search for AddType entries
  • append AddType application/x-httpd-php .php
    if you want so also AddType application/x-httpd-php-source .phps
then restart your httpd
check apache's error.log - in case I told you something wrong ;)

Posted: Sun Jan 12, 2003 10:16 am
by Innova
Hrm.....I added the LoadModule and AddType lines, but couldn't find any AddModules in my httpd.conf file.

So I figured that I'd try to start it up, and Apache said that php4_module is already runing, it was skipping it. So I thought maybe it will work now, that I needed the AddType line.

It still isn't working though. I just get the php source, like it never went to the php engine.

Posted: Sun Jan 12, 2003 6:12 pm
by volka
uh, ok it's only wild guessing right now, but have you tried

Code: Select all

<?php phpinfo(); ?>
stored in info.php?
maybe you're using short tags (<? ... ?>) and they are disabled or you've saved the script to a file with an unhandled extension?

Posted: Sun Jan 12, 2003 7:55 pm
by Innova
Wow, thanks for pointing that out. Short tags weren't working. Found the switch in php.ini and it's working fine now.

Thanks for the help.

Posted: Sun Jan 12, 2003 8:06 pm
by volka
glad it worked out.
Was my last long shot :D

Posted: Mon Feb 10, 2003 7:17 pm
by snowdave
Thanks guys. Your postings saved me a couple of hours. Same problem, same solution. Thanks again!! :lol: