Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Oct 2011 18:10:53 +0100
From:      Matthew Seaman <>
To:        Grant Peel <>
Subject:   Re: FreeBSD 8.0 -> PHP 5.3.x
Message-ID:  <>
In-Reply-To: <1A8828A857424EFDBBD748D48DF3512B@GRANTDESKTOP>
References:  <1A8828A857424EFDBBD748D48DF3512B@GRANTDESKTOP>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

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



Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP:     Ramsgate
JID:               Kent, CT11 9PW

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla -



Want to link to this message? Use this URL: <>