Php upgrade to 4.3.10 in RH 7.3
Technical
Sunday, 23 January 2005 01:59

I went to meet Amar, my boss , to discuss about my team .. and there he is, saying everything that I hate to hear . .

"Yes Sojish , I have asked you to just help your team mates .. but that doesnt mean that you shouldnt do anything . If I had been in your place , I would have been studying a lot of technical things , taking classes etc . And look at yourself , you have become a lazy bump now !! You have found special methods in whiling away your time . Do s'thing that would churn the stuff inside your head .. "

and he was right .. he charged me up . If I had seen an elephant outside , I would have smashed it into pulp. (no smilies ;-))

I went back lightened up to the development room .. and there she is .. my trusted deputy Lincy darling . She was digging into the php upgrades whenever she had time , and that gave me the initial kick start . PHP upgrade... my all time favourite . Within 1 month since I joined poornam , I was upgrading PHP in servers from 4.3.0 to 4.3.1 .( thats almost 2 years back ) .. and my server is still left with PHP 4.1.2 .. Shaaame on you, Sojish . Forgot the good old days ?? When all the gals would come asking you the doubts in PHP upgrade ... What a life that was ? ( pweeeh ) .

Njan ninachal puliye pidikkaren .. If I can put my mind into it , I can catch a Tiger !!!.......... and now I've put my mind.

Went to plesk forum .. searched a while until I got the link to atomicrocketturtle.com. Everybody is thanking them for their rpms .. and there I got all the required stuffs I wanted .

 And, when you want something, all the universe conspires in helping you to achieve it. Its called beginner's luck (p23, The Alchemist by Paulo Coelho )

I had time .. so I thought I would do a rpm rebuild . Did a couple of round ..which took almost 5 hours and installed rpms ( i lost the count after sometime ) .. and finally got a libphp4.so .. Now is the moment . I called my team mates and said .. hey I got it .. and I'm going to do a restart of apache ..

CRASH !!! libphp4.so cannot be loaded because of some OpenSSL function not being present... DING DONG .. switched back to old libphp4.so and apache started working again . Thank god . I went to sleep .

Sleep was disturbed by the cries of visakh ... webmail not working in server .  Thats bad , I woke up and went upstairs to restroom... and slept peacefully!!!

Day2

Got up at around 11 .. Lincy said , that a client is having difficulty using mysql_connect () ... Ghosh ..

Every search begins with beginners luck and ends with the victor's being severely tested. (p139 , The Alchemist by Paulo Coelho )

cleared my mind .. had food and came back later in the afternoon . I'm going to make it this time.

I realised that its not possible to do rpm --rebuild .. because the new php source requires latest open ssl , curl .. blah blah and blah .
removed the existing php rpms , Downloaded the new rpm binaries ..
Did a normal installation first for each rpm . Saved all the errors in my mind .. and then forced the installations . Everything normal till now .

restart of apache .. CRASH
Cannot load /etc/httpd/modules/libphp4.so into server: /etc/httpd/modules/libphp4.so: undefined symbol: xsltSaveResultToString

Tried to install , libxslt rpm and it asked for libxml which asked for js .... pweeh . installed all of them in reverse order .
restart of apache ... Successful . : ( Yaaaaaaaahooooooooooooooo)

Took the phpinfo in browser .. coool its upgraded . But something is wrong . .. mysql is only listed in the configure command . No further details are provided . Edited the php.ini to load mysql.so .. and restarted apache .. Still mysql is not showing .

Then I remebered the error when installing php-mysql rpm .

error: failed dependencies:
libmysqlclient.so.12 is needed by php-mysql-4.3.8-sp.rh73.1

Searched for libmysqlclient.so.12 , and realised that it requires latest mysql . Checking the
atomicrocketturtle site told that .. an upgrade of mysql is not a sure stuff . It can cause major problems with psa too .. So I removed that bad thought from my mind . Tried a work around by linking the existing libmysqlclient with the old one . ..

restarted apache .. but still its not showing mysql .

Oops forgot onething .  Just a link would not load the shared lib to memory . I have to do a "ldconfig" .. did that .. and restarted apache .... thaaaat did it . Everydetails of mysql is shown in the phpinfo

The clients issue of mysql_connect() is solved . Now the webmail .. atomicrocket have said about editing the sendmail.php file .. but still on taking the horde in browser gave warnings . Edited the php.ini to remove the warnings ... and restarted the apache again .

that turned out to be the last restart of apache .. I made it .. I DID IT ...

In his pursuit of the dream, he was being constantly subjected to tests of his persistence and courage. So he could not be hasty, nor impatient. If he pushed forward impulsively, he would fail to see the signs and omens left by God along his path. (p93)

Day 3 .

Ginu gave me the bad news .... Somebody's blog stopped working after the upgrade was done .

Tried taking his site in the browser .. it shows done .. though the page was blank .

Went to backend and changed to his blog directory and tried to execute the script using binary php

[root@myserver blog]# php index.php
Segmentation fault
[root@myserver blog]

A segmentation fault is every admins night mare .. I was always lucky because we never did any upgrades or re-compilations . But here I'm left in dark to find out whats causing the seg fault .

Inserted a "echo : Error here" line in the page and moved the line around until I found that the issue is with a line , containing ... "mysql_fetch_array() . Figuring this out took me almost 4 hours .  Wish I have mastered other debugging tools.

Now .. the usual ... Google .... Searched for mysql_fetch_array php segmentation fault and found this
http://bugs.php.net/bug.php?id=23490
incompatibilities with mysql 3.23.58 and php 4.3.4 + .... its because the latest php versions are compiled with mysql 4 library .

That brought the last days events back to my mind ... I did a work around by linking libmysqlclient.so.12 to the old libmysqlclient . .. I remember my dad telling me , shortcuts and workarounds are not permanent .. and here it is smiling straight at my face .

Complex problems have simple,  easy to understand wrong answers.  .... unknown

I cant upgrade mysql .. PHP upgrade wont work without the later mysql. Kya karen .

Smoking around .. I made a POA . Remove the link libmysqlclient.so.12 and put an actual lib file there. so I downloaded the latest mysql-shared rpm to the local machine . extracted it with "--relocate" option , so that it wont ruin the current configuration . Then uploaded it to server .

did an ldconfig and restarted apache .

Its working again .. the blog is working .. mysqlfetch array is working ... Day 3 ended with more happiness than yesterday .

:-)



Steps to upgrade to php 4.3.8 in RedHat 7.3  using RPM

1)  Download http://sojish.com/php_upgrade/php_4.1.2_to_4.3.8.tgz
2)  tar -xzf php_4.1.2_to_4.3.8.tgz
3)  cd php_upgrade
4)  Run the steps given in upgrade.sh manually.. or run    bash# sh upgrade.sh

Steps to upgrade to php 4.3.10

1) Make sure that you upgraded php to php 4.3.8 given in previous steps

2) upgrade to 4.3.10
  wget http://sojish.com/php_upgrade/php_4.3.8_to_4.3.10.tgz .
  cp -p /etc/php.ini /etc/php.ini.bkp
  tar -xzf php_4.3.8_to_4.3.10.tgz
  cd php_4.3.10
  rpm -ev --nodeps `rpm -qa | grep ^php`
  rpm -ivh *.rpm
  cp -p /etc/php.ini.bkp /etc/php.ini
  /etc/rc.d/init.d/httpd restart

 thats done with php .. check phpinfo .. to make sure .. php upgrade has
happened .
 
3) Install zend ..
    
   tar -xzf ZendOptimizer.tgz
    cd ZendOptimizer-2.5.7-linux-glibc21-i386/
    ./install

    its all default values ... and once done .. press restart .

That does it .

Steps to add Curl support  to php 4.3.10

1) wget http://sojish.com/php_upgrade/curl.so

ln -s /usr/lib/libcrypto.so.0.9.6 /usr/lib/libcrypto.so.0.9.6.1
ln -s /usr/lib/libssl.so.0.9.6 /usr/lib/libssl.so.0.9.6.1
ldconfig

cp -pr curl.so /usr/lib/php4/

Edit the php.ini to load curl.so
vi /etc/php.ini
Below the line .. : extension=imap.so add
extension=curl.so

restart httpd ...
/etc/rc.d/init.d/httpd restart

You are done ... check the phpinfo ... to make sure that curl has been enabled .


Comments
Add New
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."