CentOS PHP, MySQL, etc. Upgrade

Hi Experts,

I need to upgrade PHP 4.3.9 to PHP 5.2 (is there a better version...?)  without lots of downtime as it is in a production environment. The new install also needs newer versions of GD and MySQL and needs to include mod_ssl. The server is running on CentOS 4.4.

I would prefer to use RPM or packages rather than compile (as I've never compiled anything before...linux newbie, also because of time involved). Is there an upgrade strategy that would ensure no or microscopic chance of failure? Upgrading to CentOS 5 is not out of the question depending on amount of time it takes and also chance of failure, although, CentOS 5 only includes PHP 5.1.6.

Again, of critical importance is that nothing breaks. The only PHP software I am using is CMS Made simple, which supposedly has worked fine with PHP 5 for a long time.

Thanks,
Max
MaxwellbAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ray-solomonConnect With a Mentor Commented:
The php upgrade is simple. you may have a few seconds of downtime, but oh well huh.
The recompile can take about 10-15 minutes and depending on how busy the server is.
Login as root.

To organize better, I like to create a central download folder:

root@server# mkdir /root/setup
root@server# cd /root/setup

Download the latest package from php.net using wget and extract it, then go into the directory:

root@server# wget http://us.php.net/get/php-5.2.3.tar.gz/from/this/mirror
root@server# tar -xzvf php-5.2.3.tar.gz
root@server# rm php-5.2.3.tar.gz
root@server# cd php-5.2.3

MAKE SURE YOU CUSTOMIZE THIS CONFIGURE COMMAND, JUST COPY AND PAGE YOUR CURRENT ONES.
It will look something like this:
root@server# './configure' '--prefix=/usr' '--with-xml' '--enable-bcmath' '--enable-calendar' '--with-curl' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--enable-exif' '--with-swf=/usr/local/flash' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-iconv' '--with-imap=/usr/local/imap-2004g' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-mcrypt' '--enable-memory-limit' '--with-mhash' '--with-ming=../ming-0.2a' '--enable-magic-quotes' '--with-mysqli' '--with-mysql=/usr' '--with-openssl' '--enable-discard-path' '--with-pdflib' '--with-pear' '--with-pgsql=/usr' '--with-pspell' '--enable-xslt' '--with-xslt-sablot' '--enable-safe-mode' '--enable-sockets' '--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr' '--enable-gd-native-ttf' '--enable-wddx' '--with-xmlrpc' '--with-zip' '--with-zlib' '--disable-inline-optimization' '--enable-zend-multibyte'

root@server# make
root@server# make test
root@server# make install
root@server# make clean
0
 
MaxwellbAuthor Commented:
Hi ray-solomon,

Thanks for your quick response! Where do I find my configure command? Is there no RPM for PHP 5.2.3? What about MySQL and GD? What about Yum? Isn't that supposed to handle upgrades...or is that only for bug fixes / security patches?

Thank You for your time,
Max
0
 
rindiConnect With a Mentor Commented:
Yum is usually the best option, but it'll only work if the version of software you need is included in the repositories. Yum update will update the complete system and that should be done regularly. This will not upgrade to a next version of CentOS. I'd first use yum update to make your system current, maybe you'll then have the versions you need, and if not, then do as explained above.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
ezatonConnect With a Mentor Commented:
I think that recompilation on a production RPM based system is a mistake. Also, I feel that upgrading packages to a non-supported level can result in security holes unattended.
Check this URL about upgrading PHP using RPM. I would recommend using RPM packages (search for such packages for RHEL4), either rebuilt or downloaded from a known source. I would recommend AGAINST recompilation if there are any other alternatives. It's just that recompiled packages are unmanageable. That is why there are RPMs, after all.
Check out this link as an example:
http://www.cyberciti.biz/tips/how-to-install-php5-redhat-enterprise-linux4.html
0
 
MaxwellbAuthor Commented:
Hi,

Sorry, this issue kind of got pushed aside. Now...

Rindi:

How do I use yum to find out which version of PHP I have?

ezaton:

The article mentioned that the builds were for 64 bit machines. What do I need to do to make them work with 32 bit? Also, I would prefer if I did not have to uninstall...

Thanks,
Max
0
 
rindiCommented:
Yum list installed packagename

(probably. Being a Ubuntu User I don't remember everything about yum, but you can get details on it's usage with man yum).
0
 
MaxwellbAuthor Commented:
Rindi,

I ran the command, "yum list php" and recieved the following:


[root@localhost ~]# yum list php
Setting up repositories
update                    100% |=========================|  951 B    00:00
base                      100% |=========================| 1.1 kB    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================|  48 kB    00:00
update    : ################################################## 167/167
Added 167 new packages, deleted 227 old in 3.31 seconds
primary.xml.gz            100% |=========================| 593 kB    00:01
base      : ################################################## 1552/1552
Added 696 new packages, deleted 643 old in 13.01 seconds
primary.xml.gz            100% |=========================|  33 kB    00:00
extras    : ################################################## 122/122
Added 52 new packages, deleted 61 old in 0.42 seconds
Installed Packages
php.i386                                 4.3.9-3.22.3           installed
Available Packages
php.i386                                 4.3.9-3.22.9           base
[root@localhost ~]#

Open in new window

0
 
MaxwellbAuthor Commented:
Does this mean I can still "upgrade" to php5?

0
 
rindiCommented:
It looks like you can update to 4.3.9-3.22.9.

Have you run yum apdate already? Also look for other yum repositories. In Debian you can choose "unstable" or "Testing" repos, and these normally have more modern versions of the software titles included.
0
 
MaxwellbAuthor Commented:
That's what I suspected (that I could update to 4.3.9-3.22.9)...

I have not run yum update in a while. Is the risk minimal to a production environment?
0
 
rindiCommented:
Yes
0
 
MaxwellbAuthor Commented:
Running yum update now...
0
 
ray-solomonCommented:
Last time I checked, Yum could only upgrade to php 5.1.6

I don't think there is an official centos php rpm for anything above that.
Which is why I suggested in my first post to compile it yourself.
uninstall the old php rpm first, then compile the new version php.

You could make your own php rpm of any version if you really wanted rpm format, but that is for experience users only.
0
 
ray-solomonCommented:
If you need more help, create a 50 point pointer question in the php section that links back to this question.
This way you will get more attention and find your answer sooner.
After you find an answer here, delete the pointer question.
0
All Courses

From novice to tech pro — start learning today.