Web Hosting Talk







View Full Version : upgrading PHP


Abu Mami
03-14-2002, 05:24 AM
I'm interested in upgrading the PHP on my RedHat 7.1 server from 4.04 to 4.1.2. If anyone has any experience with this, I would like to know the following...

- Did the upgrade cause any side affects? Did your scripts stop working, or did they start act strangely? Did your hair fall out? Did you suffer dizzy spells?

- Can I undo the upgrade if things don't work after it's finished?

- How long does the upgrade take? Minutes? Hours?

- Is there a place where I can get detailed instructions on performing the upgrade?

I'm a bit afraid, err, well actually I'm terrified. If anyone could shed some light on this, it would be greatly appreciated. Thanks.

zupanm
03-14-2002, 10:28 AM
i'd recommend backing up your old apache dir and then just grabbing the latest source code for php and apache and re-installing both. Just read the INSTALL file in the php source dir, that will tell you how to install it. How long does it take? that depends on your hardware due to compile time. At most an hour and thats for a very slow system.

DigitalXWeb
03-14-2002, 10:42 AM
If PHP is compiled as a module the process is fairly simple, just download the new version of PHP and the other neccessary packages such as libiodbc and libiodbc-devel, compile in the features you wish to use, stop apache with apachectl stop and just swap out your old libphp4.so module with the one you just created, then restart Apache with apachectl start.

I would highly recommend renaming or back up your current httpd.conf and libphp4.so just in case something goes wrong you can go back to your old version :D

Abu Mami
03-14-2002, 10:55 AM
Originally posted by zupanm
i'd recommend backing up your old apache dir and then just grabbing the latest source code for php and apache and re-installing bothBoth?! Waddya tryin' to do to me? Just thinking about mucking around with my server is making me pee my pants. :-)

Do you really think I have to install the latest apache? I would rather do it in stages. PHP first since it seems to be the more urgent of the two.

Thanks for the advice. I DO appreciate it. I've just got to gather up the courage.

Abu Mami
03-14-2002, 10:58 AM
Originally posted by DigitalXWeb
If PHP is compiled as a module the process is fairly simple, just download the new version of PHP and the other neccessary packages such as libiodbc and libiodbc-devel, compile in the features you wish to use, stop apache with apachectl stop and just swap out your old libphp4.so module with the one you just created, then restart Apache with apachectl start.Umm, now this almost sounds reasonable. If I understand you correctly, I only need to create/replace one file (libphp4.so). Is this correct? How about scripts that I run from the command line, cron jobs and so forth? Will I need another executable for this?

Thanks. I'm starting to feel like this task is almost doable.

ffeingol
03-14-2002, 11:02 AM
I'm not really sure why you'd need to upgrade PHP and Apache. I would agree with you and do it one at a time ;)

You might also want to check the value of "'--prefix" from your compile (if it was set). If not, you should be able to check the include path (both from a phpinfo() page). You'll find a bin, includes and lib dir that that PHP uses. You'll want to back up those directories also.

Frank

Abu Mami
03-14-2002, 11:08 AM
Originally posted by ffeingol
I'm not really sure why you'd need to upgrade PHP and Apache. I would agree with you and do it one at a time ;)Good. I don't need the added aggravation. That's what kids are for. :-)

You might also want to check the value of "'--prefix" from your compile (if it was set). If not, you should be able to check the include path (both from a phpinfo() page). You'll find a bin, includes and lib dir that that PHP uses. You'll want to back up those directories also.I didn't have a compile. My box came with RedHat 7.1 preinstalled. I'll try the phpinfo thingy.

Thanks Frank

ffeingol
03-14-2002, 11:48 AM
All you need is a webpage with:


<?php phpinfo() ?>


Call the file anything you want with a .php extension (or however your server is setup for php scripts).

Frank

Abu Mami
03-14-2002, 11:54 AM
Originally posted by ffeingol
All you need is a webpage with:


<?php phpinfo() ?>


Call the file anything you want with a .php extension (or however your server is setup for php scripts).

Frank Thanks Frank. In fact, I already use this from time to time. What I meant was I'll try to extract the proper information from it as you mentioned in a previous post.

Thanks everyone. Hopefully I've now got all the "lego" together. I just have to muster up the courage and do it.

Abu Mami
03-31-2002, 04:39 AM
Just thought I'd resurrect this thread for an update...

I finally mustered up the courage to attempt the upgrade. For those interested, here's what I did...

1. Waited a couple of weeks trying to gather enough courage to attempt the upgrade.

2. Picked a day that I would have enough time to fix things if I broke them.

3. Followed the directions as outlined in this thread:
Upgrading PHP (Rackshack forum) (http://forum.rackshack.net/showthread.php?s=&threadid=1772&highlight=php+plesk). It didn't exactly conform to my setup, but I made the appropriate adjustments and it seemed to go OK.

4. Tried one of my sites and it came up fine.

5. Tried something with a database access and discovered that mySQL wasn't included.

6. Checked my config statement. In spite of the fact that my original config specified "without-mysql", I changed this to "with-mysql" and everything then worked just fine.

So far so good. Haven't discovered any other problems.

Thanks to everyone who offered help, and thanks to whoever posted the pointer to the Rackshack thread (It was posted in another thread on WHT, but I don't remember where). Also, thanks to Rackshack for the easy to follow instructions. It even worked (with some adjustments) on a non-Rackshack server :-)

Abu Mami
03-31-2002, 07:31 AM
No dice! Well, it works with Apache, but when I run PHP from the command line, I still get the old version.

Does anyone have an idea how I can upgrade the command-line version of PHP also?

Thanks.

priyadi
03-31-2002, 10:35 AM
Originally posted by Abu Mami
No dice! Well, it works with Apache, but when I run PHP from the command line, I still get the old version.

Does anyone have an idea how I can upgrade the command-line version of PHP also?

Thanks.

Leave out either --with-apache or --with-apxs when you configure.

Abu Mami
03-31-2002, 11:37 AM
Originally posted by priyadi
Leave out either --with-apache or --with-apxs when you configure. Do you mean that I need to run the make twice? That is, once for Apache and once for command line? Or do I just need to run make once and leave out -with-apache / with-apxs to for both?

Thanks for the help.

priyadi
03-31-2002, 03:32 PM
Originally posted by Abu Mami
Do you mean that I need to run the make twice? That is, once for Apache and once for command line? Or do I just need to run make once and leave out -with-apache / with-apxs to for both?

Thanks for the help.


You need to do it from start to finish for both Apache module and CGI separately, like this:


./configure --with-apache or --with-apxs blah blah blah
make
make install
make distclean
./configure blah blah blah with neither --with-apache nor --with-apxs
make
make install


make distclean cleans up your source directory without extracting from the tarball again.

Abu Mami
04-01-2002, 01:51 AM
Thanks Priyadi. I'll give this a try.