WEBADO Webhosting

We'll Help You Get Your Own Place on the Web

Webhosting and Design in Canada - Webado
Webhosting and design in Canada - WEBADO, Web-Ah-Do, Web-I-Do see www.webado.com

PHP5 Coming Soon to A Server Near You

A bare minimum guide in layman's terms

I don't know how many people use php on their sites and how many have had their servers migrate to php5. I'd guess not too many, since php5 appears to be a major enough change that risks seeing many php applications break. But the move to php5 is coming soon everywhere I've been told. It's been out for about a year, so it's high time to bite the bullet.

I am facing the fallout from such a migration - yikes! I am quite worried that suddenly my sites and those of my clients won't work any more or will work but be buggy every so often. So I have started collecting tidbits of information on what is changing and how it can be handled with minimal effort.

A few things that are changing are various defaults normally defined at the server level in the php configuration file php.ini:

  1. register_globals=Off by default rather than On - This affects the availability of server environment variables, form field variables (POST and GET) and query string variables. With register_globals being off you have to first get their values by either $_GET[varname] or $_REQUEST[varname] or similar constructs.
  2. short_open_tag = Off by default rather than On - Maybe the nastiest of all, as lots of php scripts rely on the short open tag . On my server however it is On for the time being.

Other more subtle changes affect how functions such as include_once and request_once are treated. For those who used them as they had been intended, not taking advantage of inhernet ambiguities that exist in earlier php versions thus allowing "creative" manipulation, they should continue working. Otherwise a shift in philosphy is needed it seems.

Under some installations the user defined php.ini is no longer supported, at least for the time being, as it seems to be a feature/bug in Cpanel. Nor can php environment settings be modified in an .htaccess file due to other security constraints. So basically what this means is that all scripts have to be made php5 compatible, without resorting to using either php.ini or .htaccess.

And other even more subtle changes are in the realm of what I call php geekdom. Stuff I've never myself used and have no clue what they are and how to use them and when and why. Probably what will do me in, in case I ever felt I was good enough in php progamming.

While it is probably safe to expect that those who wrote their own scripts can (albeit painstakingly and cursing all the way) fix their own stuff, it is less obvious what the effect will be on packaged scripts such as forums, guestbooks and other applications, especially anything using MySql databases (which also face some changes in MySql5). Hopefully their makers will provide timely upgrades to php5 compatible versions AND these upgrades will not be buggy - yeah, right!

Anyway, here are some discussions on how to migrate to php5:

Good luck to all who have to face this in the near future. I know I'm going to need it, especially since I'm a very novice php programmer still .

More FAQ ...

 

Top

 
0.06  seconds run time

Modified on: 2009-12-27