Pro PHP- Patterns, Frameworks, Testing and More

(vip2019) #1

(^42) CHAPTER 5 ■ WHAT'S NEW IN PHP 6



apt-get install apache2.2-common apache2-mpm-prefork \
apache2-prefork-dev apache2-src apache2-utils autoconf \
bison flex g++ libtool libxml2-dev re2c
Once these packages are installed, you need to install the Unicode library ICU. At the time
of this writing, the package-managed version of ICU is not compatible with PHP 6, so ICU 3.6
or higher must be manually installed. Fortunately, this installation is trivial:
mkdir ~/icu3.6
cd ~/icu3.6
wget ftp://ftp.software.ibm.com/software/globalization/icu/3.6/icu4c-3_6-src.tgz
tar xf icu4c-3_6-src.tgz
cd icu/source
mkdir /usr/local/icu
./configure --prefix=/usr/local/icu
make && make install
After you’ve completed the installation of ICU, installing PHP 6 is simple. First, find a copy
of PHP 6—sourced from http://snaps.php.net or (once the final version is released) from
http://www.php.net. The snapshot file should be called php6.0-200XXXXXXXX.tar.bz2. Use the
following commands to install PHP 6:
tar xf php6.0-200XXXXXXXX.tar.bz2
cd php6.0-200XXXXXXXX
./configure \
--prefix=/usr/local/php6 --with-apxs2=/usr/bin/apxs2 \
--with-icu-dir=/usr/local/icu
■Note If you are a Debian/Ubuntu user, pay special attention to the cautions about your modified Apache
installation. If you need additional functionality, like MySQL or PostgreSQL support, be sure to add it on the
configure line. For a complete list of configuration options, pass the --help option.
Debian/Ubuntu users may need to execute the following command due to a quirk with the
way these distributions package Apache 2.
echo #AddModule placeholder placeholder >> /etc/apache2/httpd.conf
Finally, compile and install PHP 6:
make
make install
At this point, PHP 6 should be installed, but it is not fully set up. To confirm the installation
is correct, use the following command:
php --version
McArthur_819-9C05.fm Page 42 Wednesday, February 27, 2008 8:38 AM


Free download pdf