Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 May 2012 10:54:29 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        Jos Chrispijn <ports@webrz.net>
Cc:        freebsd-ports@FreeBSD.org
Subject:   Re: PHP upgrade through port
Message-ID:  <4FAF84D5.4030709@FreeBSD.org>
In-Reply-To: <4FAF6E5E.9000200@webrz.net>
References:  <4FAF6E5E.9000200@webrz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig9913E08B90FFA93185AC0E60
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 13/05/2012 09:18, Jos Chrispijn wrote:
> Currently I use php52-5.2.17_8 but want to upgrade to php52-5.3.xxx
> through the ports.
> Can somebody tell me how I can force portupgrade to do so?

Basically you should delete any php52 or pecl ports, and anything that
depends on them.  Then install the php53 equivalents, reinstall the pecl
modules and finally reinstall your php-based applications.

As ever, make sure you have good backups before starting this procedure.

So:

  # pkg_info -IX '^(php5|pecl)' > /tmp/php-modules
  # pkg_delete -rX '^php5' 2>&1 > /tmp/php-deletion-log

You might also want to save the output of 'pecl list' (if any) and 'pear
list' if pecl and pear are installed on your system.

Force the correct base version of php to be installed:

  # portmaster lang/php5

Reinstall any ported PHP applications, eg phpMyAdmin:

  # portmaster databases/phpmyadmin

(etc., etc. for all the apps you had installed: check
/tmp/php-deletion-log for details.  This should install any necessary
dependencies.)

Finally, compare what you just installed with the record of what you
previously installed to fix up any discrepancies, eg. if you have PHP
applications installed from non-ports sources.

There isn't an exact one-to-one correspondence between php52-* and
php5-* ports (as I recall), since some functions have been moved into
the PHP core, or shifted between different modules or moved to pear- or
pecl- modules.  However, those are generally the exceptions: if you
can't find the exact equivalent php53 module, then (a) try the
application without, (b) check the documentation on www.php.net for
clues and finally (c) look for equivalent pear- or pecl- modules.  Any
PHP application installed from ports should automatically install
everything it needs through the ports dependency mechanism.

Also, if you use eAccelerator or similar, be sure to reinstall it after
upgrading PHP.

Note: the lang/php5 port is the correct port for php-5.3.x at the time
of writing, but that port is very soon going to switch to providing
php-5.4.x, and you would need to switch to lang/php53 if you don't want
to go through yet another upgrade.

Note 2: beware of the common problem with ordering of extension loadable
modules in /usr/local/etc/php/extensions.ini -- some php modules depend
on others; unfortunately there's no good way of controlling the order
the modules are listed in extensions.ini to account for this.  If php
crashes on startup, swapping lines around in that file may well be the
solution.  It's been discussed many times on this list and
freebsd-questions@..., so check the archives in case of difficulty.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey



--------------enig9913E08B90FFA93185AC0E60
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/

iEYEARECAAYFAk+vhNsACgkQ8Mjk52CukIyW2QCcC16wf5kY5DkgXfQba7FAAnCY
WQsAn2gWc5I54ILln3t2ugPGXyCdlRRt
=uA4i
-----END PGP SIGNATURE-----

--------------enig9913E08B90FFA93185AC0E60--



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