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

Installing and Configuring PHP 5

You can download PHP 5 from http://www.php.net/downloads.php. The installation process is identical to PHP 4; however, PHP 5 does have some new configuration options. See Table C-1 in Appendix C for a complete list.

During the transition from PHP 4 to PHP 5, it’s common to want to run both versions of PHP simultaneously. This lets you easily test code under PHP 5 without switching completely away from PHP 4. It also allows you to slowly migrate scripts from PHP 4 to PHP 5, as you can control which version of PHP parses specific sets of pages.

One option is to run two separate web servers, either on different machines or on different ports on the same machine. The primary advantage of using two web servers is that you can run both PHP 4 and PHP 5 as a module. The disadvantages are that you either need multiple computers at your disposal or need to be familiar with installing Apache (or your particular web server of choice). It’s also a lot of work for a temporary situation.

Another solution is to continue using your existing web server and install one version of PHP as a module and another as a CGI. This gets you up and running with both versions with minimal fuss; however, the CGI version of PHP lacks certain features included in the Apache module.

Appendix C provides detailed instructions for setting up PHP 4 and PHP 5 under Apache on both Unix and Windows. It shows how to configure Apache to switch between the versions both on a directory-by-directory ...

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