Installing PHP 6 Gotcha

Nov 13, 04:07 pm
tags:

PHP 6 has been in the works for some time now, and promises a number of long-awaited new features, including most notably complete Unicode support and namespaces. If you’re interested in giving the latest build a try, head on over to http://snaps.php.net, and download the latest source or Win32 package.

Presuming you’ll want to install it as an Apache 2 module, there’s a minor inconsistency that I’d imagine is tripping a few people up (present party included). When adding the LoadModule directive to Apache’s httpd.conf file, you need to continue referencing php5_module, even though you tie it to the php6 DLL. For instance, here’s what the relevant lines of my Windows httpd.conf file looks like:

LoadModule php5_module “c:/php60/php6apache2.dll” #LoadModule php5_module “c:/php520/php5apache2.dll” #LoadModule php5_module “c:/php514/php5apache2.dll” #LoadModule php5_module “c:/php5/php5apache2.dll”
AddType application/x-httpd-php .php
PHPIniDir “c:/php60”

Also, note I’ve used the PHPIniDir directive to point to the location of the PHP 6-specific php.ini file. This is because the php.ini file has changed for PHP 6 due to the removal of several features.

Jason



    1. It took me a while to figure that out as well! Handy article though!




Add your comments

Please keep your comments relevant to this blog entry: inappropriate or purely promotional comments may be removed. To add hyperlink, please follow this example: "your link text":http://your.link.url