SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,034
    Mentioned
    65 Post(s)
    Tagged
    0 Thread(s)

    Converting PHP 4.3.9 to 5.3.X

    Any tips? It's been awhile since I've done the 4.x to 5.x conversion, and I've never tried moving code between two engines this far apart before. No, starting over isn't an option.

  2. #2
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    989
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    What exactly isn't working? Most PHP4 code will run without a problem in PHP5. In PHP 5.2 most issues were resolved using ini_set('zend.ze1_compatibility_mode', true); however, this was removed in 5.3. I'd say try it, you might be surprised that 99% of things work (Depending how it was coded). Does the PHP4 code use objects? There's a couple of minor gotchas with comparisons that you might hit if so.

  3. #3
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,033
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Try to migrate the code from the mysql_* extension over to PDO. Depending on how your code is set up you might be able to migrate an area at a time or you might have to migrate it all at once. Is the server that the migrated code is going to run on running php 5.3.x? Unless the server is running code that won't run on any PHP version newer then 5.3.x consider migrating the server over to PHP 5.4.x or preferably 5.5.x (the latest version). How much code is there to be migrated over?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  4. #4
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    989
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by SpacePhoenix View Post
    Try to migrate the code from the mysql_* extension over to PDO. Depending on how your code is set up you might be able to migrate an area at a time or you might have to migrate it all at once. Is the server that the migrated code is going to run on running php 5.3.x? Unless the server is running code that won't run on any PHP version newer then 5.3.x consider migrating the server over to PHP 5.4.x or preferably 5.5.x (the latest version). How much code is there to be migrated over?
    5.5 is definitely not preferred, yet! It's still in beta. Running a beta version of PHP on a production web server is definitely not advisable.

  5. #5
    I solve practical problems. bronze trophy
    Michael Morris's Avatar
    Join Date
    Jan 2008
    Location
    Knoxville TN
    Posts
    2,034
    Mentioned
    65 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TomB View Post
    What exactly isn't working? Most PHP4 code will run without a problem in PHP5. In PHP 5.2 most issues were resolved using ini_set('zend.ze1_compatibility_mode', true); however, this was removed in 5.3. I'd say try it, you might be surprised that 99% of things work (Depending how it was coded). Does the PHP4 code use objects? There's a couple of minor gotchas with comparisons that you might hit if so.
    Once I resolved the PECL paths and a shared lib call it runs the homepage like a clock. I'm just looking for a list of common things that can go wrong while I sort through the mess. To be honest, the Apache config has been more a beast than the PHP so far.

    Quote Originally Posted by SpacePhoenix View Post
    Try to migrate the code from the mysql_* extension over to PDO. Depending on how your code is set up you might be able to migrate an area at a time or you might have to migrate it all at once. Is the server that the migrated code is going to run on running php 5.3.x? Unless the server is running code that won't run on any PHP version newer then 5.3.x consider migrating the server over to PHP 5.4.x or preferably 5.5.x (the latest version). How much code is there to be migrated over?
    Unlike the vast majority of old PHP projects, this particular one was built on postgres, not mysql. Availability of PDO though is one of the primary reasons for the conversion.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •