require("shared.inc"); commonHeader("Migrating from PHP 3.0 to PHP 4.0"); ?>
Migration from PHP 3.0 to PHP 4.0 is relatively easy, and should not require you to change your code in any way. There are minor incompatibilities between the two versions; You may want to check the incompatibilities list to make sure that you're indeed not affected by them (the chances you're affected by these incompatibilities are extremely slim).
Many of you are probably interested to know whether it's possible to run both PHP 3.0 and PHP 4.0 in the same server, for the duration of the transition period. Well, the simple answer is that you can't. PHP 3.0 and PHP 4.0 share a lot of common code (not in the language itself, but in the module code) and for many technical reasons, compiling the two versions into the same server is not possible. We don't expect this to change in future betas or the final release.
However, this shouldn't have too much impact on you, for two reasons:
The global configuration file, php3.ini, has changed its name to php.ini.
The MIME types recognized by the PHP module have changed:
application/x-httpd-php3 --> application/x-httpd-php
application/x-httpd-php3-source --> application/x-httpd-php-source
You can make your configuration files work with both versions of PHP
(depending on which one is currently compiled into the server), using the
following syntax:
AddType .php3 application/x-httpd-php3 AddType .phps application/x-httpd-php3-source AddType .php3 application/x-httpd-php AddType .phps application/x-httpd-php-source
In addition, the PHP directive names for Apache have changed.
Starting with PHP 4.0, there are only four Apache directives that relate to PHP:
php_value [PHP directive name] [value]
php_flag [PHP directive name] [On|Off]
php_admin_value [PHP directive name] [value]
php_admin_flag [PHP directive name] [On|Off]
There are two differences between the Admin values and the non admin values:
To make the transition process easier, PHP 4.0 is bundled with scripts that automatically convert your Apache configuration and .htaccess files to work with both PHP 3.0 and PHP 4.0. These scripts do NOT convert the mime type lines! You have to convert these yourself.
To convert your Apache configuration files, run the apconf-conv.sh script (available in the scripts/apache/ directory). For example:
~/php4/scripts/apache:# ./apconf-conv.sh /usr/local/apache/conf/httpd.conf
Your original configuration file will be saved in httpd.conf.orig.
To convert your .htaccess files, run the aphtaccess-conv.sh script (available in the scripts/apache/ directory as well):
~/php4/scripts/apache:# find / -name .htaccess -exec ./aphtaccess-conv.sh {} \;
Likewise, your old .htaccess files will be saved with an .orig prefix.
The conversion scripts require awk to be installed.
commonFooter(); ?>