PHP 5.0 has finally arrived. Here's a step-by-step guide to setting up a cutting-edge Web development environment with PHP 5.0, Apache 2.0, and MySQL 4.1.3.

After months of anticipation, PHP 5.0 has finally arrived. This latest rewrite of what was always an extraordinarily full-featured scripting language has a bunch of changes that will endear it to both novice and experienced programmers: a built-in SQLite database, more consistent implementation of the XML API through libxml2, a redesigned object model, and a brand-new Zend Engine.

You definitely want to begin using PHP 5.0 for your development activities. And since you're going to have to compile and install it anyway, why not upgrade your entire LAMP (Linux, Apache, MySQL, PHP) development environment? After all, there have been a series of new releases over the past few months: MySQL 4.1.3, with support for character sets, collations, subqueries, and transaction savepoints; Apache 2.0 is stable; and your Linux vendor almost certainly has a new distro you're dying to try out.

I'm going to run you through the process of setting up a cutting-edge development environment for Web scripting with PHP, using PHP 5.0, Apache 2.0, and MySQL 4.1.3. Start your terminals and warm up the compilers. Let's get going!

The basics
I'm assuming that you already have a version of Linux installed and it's operational. Make sure you have a working C compiler, or you won't be able to proceed.

You also need to make sure you have downloaded all the relevant software:

  • The latest binary version of MySQL (currently MySQL 4.1.3-beta), available from MySQL.com
  • The latest version of PHP (currently PHP 5.0.0), from Php.net
  • The latest version of Apache 2 (currently Apache 2.0.50), from Apache.org

Important note: As of this writing, the combination of Apache 2.0 and PHP 5.0 is not completely thread-safe and should not be used together in high-volume production systems. However, the combination should be fine for development systems.

You may also need the following support libraries:

  • The latest libxml2 library (currently libxml2 2.6.11), from XmlSoft.org
  • The latest zlib library (currently zlib 1.2.1), from Gzip.org

Copy all of these to your /tmp directory and decompress them as follows:

$ cd /tmp
$ tar -xzvf mysql-standard-4.1.3-beta-pc-linux-i686.tar.gz
$ tar -xzvf php-5.0.0.tar.gz
$ tar -xzvf httpd-2.0.50.tar.gz
$ tar -xzvf libxml2-2.6.11.tar.gz
$ tar -xzvf zlib-1.2.1.tar.gz

Installing the support libraries
First, check if you need to install libxml2 or zlib. PHP 5.0 requires libxml2 2.6.0 (or better) and zlib 1.0.9 (or better). If you don't have both of these, keep reading; otherwise, skip to the next section.

To begin, compile and install the libxml2 XML parser, which provides the base for the new XML API in PHP 5.0:

$ cd /tmp/libxml2-2.6.11
$ ./configure
$ make && make install

At the end of this, libxml2 should be installed under /usr/local/. If you want this installed elsewhere, you should specify the --prefix option to the configure script in the previous step.

Next, do the same for zlib, which provides compression services for a number of extensions:

$ cd /tmp/zlib-1.2.1
$ ./configure
$ make && make install

At the end of this, zlib should also be installed under /usr/local/. As before, you can use the --prefix option to install it somewhere other than the default.

Do you need help with Linux? Gain advice from Builder AU forums

Related links

Comments

1

Mathew Snyder - 07/06/05

It's about time I found a HowTo for setting up PHP 5, Apache 2 and MySQL in a simple and brief format. Thanks, this is exactly what I needed. Everything else was either convoluted or just unhelpful.

» Report offensive content

2

Dixon Davis - 15/10/07

Very very useful guidelines and is perfect for the installation. Saved lots of my time and implemented almost all dependencies.
Thanks a lot :)

» Report offensive content

3

max-icon - 16/10/07

4

moamer - 21/10/07

i think thes site its very good to studient

» Report offensive content

5

twilachamb - 20/09/09

exert part developers roughly page

» Report offensive content

6

marstonhur - 20/09/09

decrease 1980 <a href="http://www.gottabemobile.com">douglass increases cloud reducing</a> greenhouse <a href="http://reviews.cnet.com">protocol ruddiman</a>

» Report offensive content

7

garsonemit - 20/09/09

http://pagesperso-orange.fr generation references http://www.si.edu

» Report offensive content

8

dannaleego - 20/09/09

sunlight amount negative changes glacial scale low

» Report offensive content

Leave a comment

You must read and type the 6 chars within 0..9 and A..F

* indicates mandatory fields.

8

dannaleego - 20/09/09

sunlight amount negative changes glacial scale low ... more

7

garsonemit - 20/09/09

http://pagesperso-orange.fr generation references http://www.si.edu ... more

6

marstonhur - 20/09/09

decrease 1980 <a href="http://www.gottabemobile.com">douglass increases cloud reducing</a> greenhouse <a href="http://reviews.cnet.com">protocol ruddiman</a> ... more

Log in


Sign up | Forgot your password?

  • Staff Microsoft shows off IE9 preview

    This week, highlights from Microsoft's MIX10 conference and more in the Roundup. Read more »

    -- posted by Staff

  • Chris Duckett IE9's H.264 vote killed Ogg

    In a split decision by the judges, the winner of the W3C/WHATWG video codec consensus is H.264, taking home the future of video playback on the internet while loser Ogg goes home with nothing but thoughts of what might have been. Read more »

    -- posted by Chris Duckett

  • Staff Google launches Apps Marketplace

    Google launches and app store, while Mozilla plans to re-write its open-source license. More of this week's news in the Roundup. Read more »

    -- posted by Staff

What's on?

  • Optus Deal

    Broadband + home phone + PlayStation®3 in a single package price!