Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Oct 2011 18:10:53 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Grant Peel <gpeel@thenetnow.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: FreeBSD 8.0 -> PHP 5.3.x
Message-ID:  <4E8DE11D.6050608@infracaninophile.co.uk>
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)
--------------enigA249478639B819C933E284CA
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

	Cheers,

	Matthew

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6N4SQACgkQ8Mjk52CukIw81QCfb8vxbQoXZhMmRz8VyJHmg2xb
8rQAoIHvX+PmfncLZT9P2wChD32EgoKy
=U4yd
-----END PGP SIGNATURE-----

--------------enigA249478639B819C933E284CA--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E8DE11D.6050608>