Skip to Main Content
Upgrading to PHP 5
book

Upgrading to PHP 5

by Adam Trachtenberg
July 2004
Intermediate to advanced content levelIntermediate to advanced
350 pages
10h 9m
English
O'Reilly Media, Inc.
Content preview from Upgrading to PHP 5

Windows

If you’re running Windows, it’s not easy to compile PHP, and you’re probably already using PHP 4 as a CGI. Here’s how to integrate a precompiled version of PHP 5 into an existing Apache setup:

  1. Download and install a precompiled Windows zip package.

  2. Configure your web server to handle PHP 5.

  3. Set an alternative php.ini location.

If you’re using another web server, you will need to modify the configuration directions.

The first step is downloading and unzipping PHP 5. You can download Windows zip packages from http://www.php.net/downloads.php. (Be sure to grab the “zip” package instead of the installer.)

After you unzip the package, move it to a directory that is similar to your existing PHP 4 installation. On many systems, PHP 4 is at C:/PHP/, so these instructions place PHP 5 in C:/PHP5/.

Copy php.ini-recommended to php.ini and keep it in C:/PHP5/. Your pre-existing php.ini file is already located in someplace like C:/WINNT/, but you’re not ready to overwrite it yet. Make whatever server-specific customizations you need to the new php.ini file.

Now you need to modify your web server configuration file to handle PHP 5. If you’re running PHP 4 as a CGI, you should already have these three lines:

ScriptAlias /php/ "C:/PHP/"
Action application/x-httpd-php /php/php.exe
AddType application/x-httpd-php .php

This makes the file located at /php/php.exe under the document root execute files ending in .php. The ScriptAlias directive links this location to C:/PHP/php.exe on your filesystem.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Expert PHP and MySQL®

Expert PHP and MySQL®

Andrew Curioso, Ronald Bradford, Patrick Galbraith
Pro PHP Programming

Pro PHP Programming

Peter MacIntyre, Brian Danchilla, Mladen Gogala
Mastering PHP 7

Mastering PHP 7

Branko Ajzele

Publisher Resources

ISBN: 0596006365Supplemental ContentCatalog PageErrata