From owner-freebsd-questions@FreeBSD.ORG Sat Jul 22 08:03:23 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F89616A4DA for ; Sat, 22 Jul 2006 08:03:23 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.187.76.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B1F943D46 for ; Sat, 22 Jul 2006 08:03:21 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from [IPv6:::1] (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.13.6/8.13.6) with ESMTP id k6M82sk2096122; Sat, 22 Jul 2006 09:02:54 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) Authentication-Results: smtp.infracaninophile.co.uk from=m.seaman@infracaninophile.co.uk; sender-id=softfail; spf=softfail X-SenderID: Sendmail Sender-ID Filter v0.2.13 smtp.infracaninophile.co.uk k6M82sk2096122 Message-ID: <44C1DBA6.7060900@infracaninophile.co.uk> Date: Sat, 22 Jul 2006 09:02:46 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 1.5.0.4 (X11/20060610) MIME-Version: 1.0 To: mamrg References: <44C15798.5060906@tuxdoit.com> In-Reply-To: <44C15798.5060906@tuxdoit.com> X-Enigmail-Version: 0.94.0.0 Content-Type: multipart/signed; micalg=pgp-ripemd160; protocol="application/pgp-signature"; boundary="------------enig1C25FAAB08A1C687B4DD5223" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (smtp.infracaninophile.co.uk [IPv6:::1]); Sat, 22 Jul 2006 09:03:14 +0100 (BST) X-Virus-Scanned: ClamAV 0.88.3/1614/Fri Jul 21 21:27:38 2006 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: Upgrade PHP X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2006 08:03:23 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig1C25FAAB08A1C687B4DD5223 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable mamrg wrote: > Hi, >=20 > First of all my apologies for the lame question, but i have this FreeBS= D > server in which i have to upgrade PHP from 4 to 5. >=20 > I've read about the ports, but got a little confused. > Can you tell me please how can i make the update ? Hmmm... this will take a little more effort than is usual when dealing with the ports. But not a huge amount more. First, identify all of the ports that use php -- you want anything that is a dependency of the core lang/php4 port. You need a command something= like the following, except you will have to alter the version number to match what you have installed: % pkg_info -R php4-4.X.Y Something like this: % pkg_info -R php4-4.4.2_1=20 Information for php4-4.4.2_1: Required by: oscommerce-2.2r2 pecl-pdflib-2.0.4 php4-bz2-4.4.2_1 php4-gd-4.4.2_1 php4-mbstring-4.4.2_1 php4-mcrypt-4.4.2_1 php4-mysql-4.4.2_1 php4-pcre-4.4.2_1 php4-session-4.4.2_1 php4-zlib-4.4.2_1 phpMyAdmin-2.8.0.3 This will get you the right list of ports to deal with. Now, you need to= replace each of those ports called 'php4-something' with the equivalent 'php5-something' port. You need to do the base php port first: % cd /usr/ports/lang/php5 % make config (Note: make sure 'Apache' is = checked here) % portupgrade -f -o lang/php5 php4-4.4.2_1 Remember to tweak that version number to match what is on your own system= =2E After you've done that, there should be a file /usr/local/etc/php.conf that contains the following: % cat /usr/local/etc/php.conf PHP_VER=3D5 PHP_VERSION=3D5.1.4 PHP_SAPI=3Dcli cgi mod Now go ahead and replace all of the php4 modules with their php5 equivalents. You need to find the origin of each php4 module, and then translate it into the php5 equivalent. eg: % pkg_info -o php4-mysql-4.4.2_1 Information for php4-mysql-4.4.2_1: Origin: databases/php4-mysql % portupgrade -o databases/php5-mysql php4-mysql-4.4.2_1 Do that for each of the php4-something modules. Next, and somewhat optionally, reinstall all of the PECL libraries and PHP applications you've installed. ie. anything on that list of dependencies without the php4- prefix. This isn't strictly necessary for= anything that is pure PHP code and that involves no compiled stuff, but it shouldn't hurt. eg: % portupgrade -f pecl-pdflib-2.0.4 % portupgrade -f phpMyAdmin-2.8.0.3 % portupgrade -f oscommerce-2.2r2=20 > Is it necessary to mess with Apache too ? Yes. You should stop apache before starting on this whole exercise, obviously. Before you fire it up again, you need to make sure that it is loading the PHP5 module rather than the PHP4 one. Check for lines like this in the apache config files: LoadModule php5_module libexec/apache22/libphp5.so (Again, mutatis mutandem depending on the version of Apache you're running) The Apache config files may well be automagically edited for you, but the 'LoadModule' line could well have been put in commented out, which you'll want to uncomment. Then fire up Apache and test, test, test until you're sure everything is working OK. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig1C25FAAB08A1C687B4DD5223 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEwdut8Mjk52CukIwRA7/tAJ91HoLVF+e0txLYV4PjsEIH+SZaiwCgh4R6 HR7RPyIyoSdq+8wqp7v91v4= =UZZA -----END PGP SIGNATURE----- --------------enig1C25FAAB08A1C687B4DD5223--