Jason Fesler wrote:
>> My PHP is the one in my FreeBSD ports (I didn't even patch it
>> explicitly), and despite the many "easy" guides to updating a FreeBSD
>> system, I haven't been able to figure out how to actually do that
>> safely.
> 
> Upgrade your ports with cvsup, then upgrade the specific packages you
> installed.  Looks like php 5.2.3 is currently in
> /usr/ports/lang/php5/Makefile .  Check the freebsd handbook for "cvsup";
> you might also want to look at the package "portupgrade" (should be in
> your ports directory as well).

David,

Although this is a getting little off-topic for RoundCube development, it
might help you and potentially others so here goes:

In FreeBSD 6.x and newer, "csup" (a c-based cvsup replacement) is included
in the base system and you do not have to install anything extra to use it.
Installing the cvsup client, especially via source, takes a while and brings
in some hefty dependencies.

It may be as simple as running:

csup -h cvsup4.freebsd.org /usr/share/examples/cvsup/ports-supfile
cd /usr/ports
make fetchindex

You may want to sub another number for the cvsup server, 1-18 used to work
but I think there are some gaps currently.

If you are still running FreeBSD 5.x, you'll have to use the cvsup client
which may be installed as:
  pkg_add -r cvsup-without-gui
 or
  pkg_add -r cvsup
Depending on whether or not you have (or want) the xorg/X11 libraries installed.

You can install the portupgrade port, as Jason mentioned and then update PHP
as well as the extensions like so:
   portupgrade php5-\*

While you're at it, you may want to update Apache, and some other programs.
You can check to see which ports/packages are out of date with
   pkg_version -vL=

A couple caveats to this, however, from my experience:

1. Look at /usr/ports/UPDATING after you csup/cvsup. Some things may bite
you when trying to update PHP, such as the recent autoconf update, or if you
need the X11 libs, the xorg 7.2 conversion section may need to be done.
There are plenty of detailed instructions in the UPDATING file for each
action you need to perform.

Personally for the xorg upgrade I just put WITHOUT_X11=yes in /etc/make.conf
and rebuilt php and others so they did not require X libraries, then removed
the unneeded xorg ports/packages. This may not be feasible if you really do
need things that rely on xorg libraries.

2. You may need to
     cd /usr/ports/lang/php5
     make config
   - Ensure APACHE is checked

3. Be aware of the order the extensions get installed. In some cases, the
extension order can cause Apache to die.
 See: http://www.pingle.org/2006/10/18/php-crashes-extensions/
 And: http://www.pingle.org/2007/05/13/php-crashes-extensions-2/

  This can be fixed by editing your php.ini after the upgrade is done and
putting the modules in a better order.

4. If you have cron jobs that use PHP scripts, such as cacti's poller, you
may want to disable them during the upgrade as the scripts may fail as parts
get uninstalled and reinstalled. They may also fail because of the extension
ordering mentioned above.

I maintain PHP installs on several servers, updating as needed, and the only
thing that gets me on a regular basis is having to check and recheck the
extension ordering. Often this is as easy as backing up my current
/usr/local/etc/php/extensions.ini and then copying it back after portupgrade
finishes.

In reality, it sounds a lot scarier than it is. Roundcube, as well as other
apps, will probably be happier on a more up-to-date installation of PHP.
Not to mention more secure.

Jim
_______________________________________________
List info: http://lists.roundcube.net/dev/

Reply via email to