FreeBSD 8.0 -> PHP 5.3.x

Matthew Seaman m.seaman at infracaninophile.co.uk
Thu Oct 6 17:11:08 UTC 2011


On 06/10/2011 16:55, Grant Peel wrote:
> Short of upgrading the OS, what is the safest way to upgrade a
> FreeBSD server to PHP 5.3.x from 5.2.11 ? I am assuming downloading
> the ports tarball and rebuilding and reinstalling will do it? Any
> advice, samples would be appreciated

8.0 is out of support now as I recall.  Recommend upgrading to 8.2 --
you should be able to update the base system independently of updating
any ports as the ABI won't change because it's all the same major
version number.

Update your ports tree to the latest.  Update your installed ports to
the latest available.  You can omit upgrading PHP and things like
eaccelerator since you'll be deleting and reinstalling them shortly.

Make backups of all of your PHP related ports.  Take note of which are
the actual applications you want to run -- there are some differences in
the available modules between the php52 and the php5 ports, so it won't
necessarily be an exact one-for-one swap.

Now remove the base php52 port and every port that depends on it.
Install the core lang/php5 port -- this resets the default PHP version
on your system -- then reinstall your applications, allowing them to add
any necessary modules automatically to fulfil their dependencies.  If
your PHP application code is not installed via ports, then you'll have
to manually work out which modules to install -- this is likely to be
pretty similar to what you needed with php52 but not necessarily exactly
the same.  Usually it's a matter of installing a bunch of stuff, trying
the application, noting what throws errors due to missing functions and
installing the needed modules to provide that.  Rinse, repeat.

This is safe, in that you should end up with a functioning system, but
it is pretty intrusive and requires significant amounts of downtime on
your system.  To minimize all that, probably the best thing to do is
clone your web server into a jail or VM, work on the upgrade there at
your leisure, including all needed debugging.  Then you should be able
to make packages of all the ports in your test system and use those to
quickly apply the changes to your live system.

This is a key command-line you'll need for that:

   pkg_create -Rbn portname

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20111006/60139041/signature.pgp


More information about the freebsd-questions mailing list