Page 1 of 1

Quick PHP Install question!

Posted: Tue Aug 09, 2005 12:15 am
by influx
Hey all,

I am running a server with Red Hat 9...and when I type 'php-v' in the command prompt, it tells me that the server has PHP 4.3.5...however when I check phpinfo() on a page, it tells me I have 4.2.2.

I know that the server is officially running 4.2.2 because I try using functions (i.e: mysql_real_escape_string) that were introduced afterwards 4.3, but get fatal errors. Does anybody know what could be causing this?

Also, the server is running on Apache 2.0 and may be running PHP as a module.

What could be causing this? Can I disable 4.2.2 somehow to allow 4.3.5 to take effect?

Thanks!

Posted: Tue Aug 09, 2005 8:47 am
by feyd
Moved to Web Servers.

Posted: Wed Aug 10, 2005 12:19 am
by influx
Since it seems I have two versions installed...one as a module for Apache and the other separately...how would I disable the Apache PHP module an enable the standalone version 4.3.5? Thanks!

Posted: Wed Aug 10, 2005 12:22 am
by feyd
from what I know, just edit the httpd.conf file pointing the php reference to the new location of 4.3.5, should be golden. Follow the installation instructions that come with the PHP download for additional details.

Posted: Wed Aug 10, 2005 10:05 am
by pickle
If you're running Apache 2, you'll want to edit httpd2.conf (in /etc/httpd/conf/ on my Mandrake installation). The line to change is:

Code: Select all

LoadModule php4_module        /usr/lib/apache2-2.0.44/libphp4.so

Posted: Mon Aug 15, 2005 12:23 pm
by influx
pickle wrote:If you're running Apache 2, you'll want to edit httpd2.conf (in /etc/httpd/conf/ on my Mandrake installation). The line to change is:

Code: Select all

LoadModule php4_module        /usr/lib/apache2-2.0.44/libphp4.so
Hrm, I tried that and it doesn't work...it just shows my PHP source code at every page.

So now I think the answer to this will solve my problem: How can I configure Apache 2 to use the commandline php to execute files with the .php extension?

Thanks!
-influx

Posted: Mon Aug 15, 2005 1:05 pm
by timvw
You would have to look at the "install php as CGI" section..

Posted: Mon Aug 15, 2005 1:07 pm
by timvw
influx wrote:
pickle wrote:If you're running Apache 2, you'll want to edit httpd2.conf (in /etc/httpd/conf/ on my Mandrake installation). The line to change is:

Code: Select all

LoadModule php4_module        /usr/lib/apache2-2.0.44/libphp4.so
Hrm, I tried that and it doesn't work...it just shows my PHP source code at every page.
Btw, you may ask yourself why it doesn't work. When you started apache, didn't apache complain about a missing module? (Check your error log for that...)

Posted: Mon Aug 15, 2005 4:53 pm
by ashkon
Influx and I are having the same issue.

Here's what I tried.

Apache's httpd.conf file in Redhat 9 loads several other config files. One of those config files is "php.conf". Here is the content of php.conf:

Code: Select all

LoadModule php4_module modules/libphp4.so

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

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
I modified Apache's config such that it no longer loads php.conf. What i need to know now is how to have files with a .php extension be passed off to the command line version of php (located at /usr/local/bin/php).

The example in the apache tutorial refers to ExtFilterDefine command but I don't have the proper module (i.e. mod_ext_filter) installed to use that command. Any suggestions?

Posted: Mon Aug 15, 2005 5:06 pm
by feyd
what's wrong with

Code: Select all

<IfModule mod_mime.c>
AddType application/x-httpd-php .php
</IfModule>
:?: