LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   php upgrade almost worked - apache still uses old version (https://www.linuxquestions.org/questions/linux-server-73/php-upgrade-almost-worked-apache-still-uses-old-version-526974/)

monk.e.boy 02-09-2007 05:29 AM

php upgrade almost worked - apache still uses old version
 
Hello,

I am a new Linux user :)

I am using RedHat, and I have downloaded php 4.4.4 and done ./configure, make, make install and everything worked ok. If I do /usr/bin/php -v I get:

PHP 4.4.4 (cgi) (built: Feb 8 2007 09:54:41)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies


Horah! But apache is still picking up the original version of php, 4.3.9 How do I uninstall 4.3.9, or stop apache looking at it? How do I even find both versions? I have tried "whereis php" and "find / -name php" but both just show me the 4.4.4 version :cry:

We have a Linux guru who we pay to help us out, but his wife is having a baby and we are a bit stuck for a couple of weeks :-)

Thanks in advance for any help!

monk.e.boy

bathory 02-09-2007 07:00 AM

You should at least run:
Code:

./configure --with-apxs2=/path/to/apache/apxs
to create the php module for apache (if you're using apache 1.3.x then it should be ./configure --with-apxs=/path/to/apache/apxs).
Take a look at apache httpd.conf (or any other .conf used by an "Include" directive in httpd.conf) to see from where it's loading the older php module.

monk.e.boy 02-09-2007 07:28 AM

This is my httpd.d/php.conf:

Code:

#
# 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 to handle files with a .php extension.
#
AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps

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

I compiled php like :

Code:

./configure --with-mysql -–with-apxs2=/usr/sbin/apxs -–prefix=/usr –with-curl -–with-dom -–with-zlib-dir=/usr/include/ --enable-ftp
Where would apache be finding the old version of php?

Thanks for the help so far :-)

monk.e.boy

life v.2

bathory 02-09-2007 08:26 AM

Quote:

LoadModule php4_module modules/libphp4.so
Is this the module you're trying to install? Check the date to see if it is the one you compiled. Also did you restart apache to see if it starts using your php module?
Quote:

Where would apache be finding the old version of php?
It depends on how php was installed. I'm not familiar with rpm based distros, but I think that it was just the apache module installed. Use your package manager to see what parts of apache/php are installed.

Regards

mrtwice 02-10-2007 12:11 PM

First off, let me recommend that you use checkinstall to make RPMs instead of using "make install". Using an RPM provides a clean way of backing out your changes if something doesn't work right:

http://asic-linux.com.mx/~izto/checkinstall/

Second, have you restarted Apache yet? Apache won't pickup the new version until you restart it.

Third, use

Code:

updatedb
and then

Code:

locate libphp4.so
to locate any files on your system. Use

Code:

man
to figure out what those commands are use for if you are not familiar with them.


All times are GMT -5. The time now is 11:42 AM.