• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

How can I upgrade to latest php version?

I installed php while installing RedHat 7.2 And everything is working fine.
But now I want to upgrade php to latest version. I want to enable mysql,apache and Imap while installing php. I downloaded the latest version of php gz.
Do I have to remove the previous php version?
Where should I put this gz file to untar and configure.
If I simply ./configure and make then will it take all the php functions or I have to specifiy the options like mysql, imap and apache.
Thanks.
0
konfusion
Asked:
konfusion
1 Solution
 
bobsledbobCommented:

First off, there's a ton of installation information available at:

http://www.php.net/manual/en/installation.php


Secondly, since you're running PHP as installed by RedHat, you will have an RPM version of PHP.  As root on your machine, do this:

# rpm -qa | grep php

This will show you everything you've got installed relating to PHP.

If you want to compile and install from scratch, you'll want to first remove your PHP package like this:

# rpm -e php

(note, you'll want to remove everything that is returned by the first rpm -qa command.  That is, you might have some other PHP related RPMS installed).

Next, after downloading the PHP source, I tend to like to put my source into:

/usr/local/src

To unzip and untar:

cd /usr/local/src
mv ~/php-4.3.1.tar.gz .
tar zxvf php-4.3.1.tar.gz

Now:

cd php-4.3.1
./configure --with-apxs=/path/to/apache/bin/apxs  --with-imap=/path/to/imap/directory

note, by default, mysql support is automatically installed.  IF however you use MySQL from other places (such as Perl), then you WILL need to include a --with-mysql=/path/to/mysql/directory  otherwise, there will be conflicts when PHP tries to access Mysql

apxs is Apache's module installer, if you didn't know.  this will compile PHP as an apache module and will install it into the appropriate module directory and modify your configuration file so that the module is loaded by apache when needed.

The PHP manual is your friend.
0
 
us111Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: bobsledbob

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

us111
EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now