From owner-freebsd-questions@FreeBSD.ORG Thu Sep 4 11:13:44 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69E4D106566B for ; Thu, 4 Sep 2008 11:13:44 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id EB8E98FC23 for ; Thu, 4 Sep 2008 11:13:43 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KbCmS-0002Dj-9E for freebsd-questions@freebsd.org; Thu, 04 Sep 2008 11:13:40 +0000 Received: from pool-141-156-180-91.esr.east.verizon.net ([141.156.180.91]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Sep 2008 11:13:40 +0000 Received: from nightrecon by pool-141-156-180-91.esr.east.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Sep 2008 11:13:40 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Michael Powell Date: Thu, 04 Sep 2008 07:15:53 -0400 Lines: 78 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pool-141-156-180-91.esr.east.verizon.net Sender: news Subject: Re: [6.3] Upgrading PHP5? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nightrecon@verizon.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2008 11:13:44 -0000 Gilles wrote: > Hello > > I successfully upgraded the Ports collection with csup and then > compiled Apache2, but I don't know what to do about PHP5, as it has > several Ports available: > > php5-5.2.6 < needs updating (port has > 5.2.6_1) This is the main PHP section. > php5-bz2-5.2.6 < needs updating (port has > 5.2.6_1) > php5-ctype-5.2.6 < needs updating (port has > 5.2.6_1) > php5-curl-5.2.6 < needs updating (port has > 5.2.6_1) > etc. These are the extensions. Not quite sure what you're asking here. I use portupgrade to upgrade. I'm not sure if you're asking about upgrading, or getting PHP going on the Apache install for the first time. If it's already there and working but just needs updating portupgrade can do this. If you are coming into situation "in the middle" and have Apache up and running correctly but these above mentioned ports are leftovers from before you became involved you may consider simply deleting them and starting over fresh. Either start over or update, both can work. You can use pkg_delete, make deinstall in the port directory, or (if portupgrade is installed) pkg_deinstall. The above list may be confusing because there are two separate sections to a PHP install. The first is PHP itself. This is /usr/ports/lang/php5 - a make config screen will come up and in the options list you'll see one to include mod_php. There are a couple of messages at the end containing a couple of lines you'll need to add to httpd.conf for php to work. The extensions are found here: /usr/ports/lang/php5-extensions These contain all of the different PHP function modules. The most common example is this is where you would add/activate MySQL access for PHP. When you do make, or make config, in the port you will get a list to choose. You can install only what you know you need, or you can install all of them and comment out the ones you don't need in /usr/local/etc/php/extensions.ini As far as the httpd.conf goes you really need two things. One the mod_php option should have probably installed and just needs checking. Look for a LoadModule php5_module libexec/apache22/libphp5.so entry at the bottom of the LoadModule list. The other are the two lines mentioned at the end of the port install. Look for the section. I think these are already present but commented out (it's been a really long time since I've done a virgin install), if not add (under the section in the httpd.conf): AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps The problem you'll encounter when these aren't present is the web server will just serve up the contents of the .php script without actually running it. A real easy test to see if PHP is working correctly is just create some file in the root of your web server such as php_test.php containing this: If everything is fine it'll return all the info on your PHP install. Hope this helps. -Mike