You are Here:
FAQ
Scripting and Programming Languages
PHP
PHP5 Upgrade
Article #4
How difficult is the transition from PHP4 to PHP5? Linux Packages Only!
This includes:
During the development of PHP5, care was taken to change the code as little as possible. Therefore, the transition from PHP4 to PHP5 is much easier than the transition from earlier versions. For more information on the most notable changes, please reference What's new in PHP5? Most of the PHP scripts should run with little or no modification when using PHP5. To ensure a smooth transition however, we recommend testing the execution of your PHP code as PHP5. To do this, it is suggested to copy all of your site files to another folder to ensure the live site is not affected. Creating a subfolder is best as you can then access the copy of your files easily. For example, if you website is http://www.1and1help.com/ then create a new folder named test where all of your site files are currently saved. Now copy all of your site files to the test/ subfolder you just created. Within this new subfolder with a copy of your site files, create a (or edit an existing) .htaccess file using a text editor such as WordPad, Notepad, vi, nano, etc. with the following line:
Save this file as .htaccess to the subfolder where you copied all of your site files. This will force all files with the .php or .php4 extension in this subfolder to be parsed as PHP5. You should now be able to check how the copy of the site reacts when using PHP5 by opening a browser and navigating to http://YourDomainName.com/TheSubfolderYouCreated/ such as http://www.1and1help.com/test/ If you have many redirection or rewrite rules for your site's URLs, you may not be able to properly test a copy of the site in a subfolder as the links will not work correctly. In this instance, it is suggested to create a (or edit an existing) .htaccess file using a text editor such as WordPad, Notepad, vi, nano, etc. in the folder where all of your live site files are saved. You may make this change during the hours when you receive the least amount of traffic to ensure that not many viewers are affected if the site does not function properly on PHP5. If it appears the site does not function properly using PHP5, simply remove the AddType x-mapp-php5 .php .php4 line from the .htaccess file to revert back to PHP4. See Also: What if my PHP scripts will not work using PHP5? |
© 2012 1&1 Internet Inc - About 1&1 Internet