Quick PHP Install question!

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
influx
Forum Commoner
Posts: 31
Joined: Fri Aug 05, 2005 9:28 am

Quick PHP Install question!

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Moved to Web Servers.
influx
Forum Commoner
Posts: 31
Joined: Fri Aug 05, 2005 9:28 am

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post 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
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
influx
Forum Commoner
Posts: 31
Joined: Fri Aug 05, 2005 9:28 am

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

You would have to look at the "install php as CGI" section..
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...)
ashkon
Forum Newbie
Posts: 1
Joined: Mon Aug 15, 2005 1:11 pm

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what's wrong with

Code: Select all

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