If PHP 5.4 breaks my site would it require major repairs to fix it?

5 replies
1) If I flip the switch in my cpanel from the current PHP 5.2 to PHP 5.4, is it possible that if it breaks my website that it would require major work to get the site back the way it was even AFTER switching back to PHP 5.2?

2) I have a few old HTML sites that I built with XsitePro 2 that I'm going to rebuild with WP a little later in 2016. Does anyone know if XsitePro 2 will work with PHP 5.4?

Thanks
#breaks #fix #major #php #repairs #require #site
  • Profile picture of the author jeffatrackaid
    Don't blindly do this - use a development server.

    Depending on your OS and MySQL version, you may also have to update MySQL. A MySQL update could cause more issues than PHP. The issue is you cannot downgrade MySQL via cPanel. You have to do it manually at the command line and will need a pre-upgrade MySQL backup. If you are not a sysadmin, I don't recommend you attempt this. I don't even let our junior sysadmins do this.

    In terms of PHP, magic quotes was dropped in PHP 5.4 and some other functions. Magic quotes was a popular in earlier PHP programs, so that alone could break your app.

    The process we use is to setup a cheap VPS server, clone over the site and apache configuration. Test the site. Then upgrade PHP to 5.3 then to 5.4 testing at each phase.

    Once complete, you can then update your production system with less risk.

    Make sure to make both file level and MySQL backups prior to update.

    The biggest risk with legacy apps is that encoding or other data encapsulation may be altered by changes in PHP. If this occurs, then data could be corrupted or entered correctly with no way to back out except reverting to your backups. This is why you need to test all aspects of the site. Test checkout, sign ups, emails, admin functions etc.

    While adding some time and costs, you can avoid firefighting and loss revenue in case of a meltdown.
    {{ DiscussionBoard.errors[10465094].message }}
  • Profile picture of the author magentawave
    So what you are saying is that it is very possible that upgrading PHP could damage my sites and that downgrading the MySQL later must be done manually.

    That leads to a couple questions, please...

    1) Wouldn't making a backup of the entire cpanel backup the MySQL too?

    2) And if so, wouldn't that also mean that if I had to revert back to PHP 5.2 that I could simply replace everything after the upgrade with the backup thus avoid having to manually downgrade the MySQL?
    {{ DiscussionBoard.errors[10465359].message }}
    • Profile picture of the author jeffatrackaid
      cPanel will not downgrade the MySQL server software automatically. You have to remove and re-install the old MySQL version AND re-import your MySQL backups.
      {{ DiscussionBoard.errors[10472426].message }}
      • Profile picture of the author magentawave
        Originally Posted by jeffatrackaid View Post

        cPanel will not downgrade the MySQL server software automatically. You have to remove and re-install the old MySQL version AND re-import your MySQL backups.
        Hostgator says it's just a matter of flipping the switch to go up or down. I went from 5.2 to 5.4 with no problems at all and don't anticipate ever having to go down.

        Thanks for your input.
        {{ DiscussionBoard.errors[10472616].message }}
  • Profile picture of the author PeachCoding
    If you have access to the WHM side of the cPanel account with root level access then yes you can change the versions of both MySQL and PHP individually or at the same time using easyapache when logged in as root to WHM.

    And I fully recommend setting up a development environment to do the upgrade for as I've helped many companies & people fix problems from upgrading PHP or MySQL to newer versions and the problem sizes ranged from as easy as replacing a function name to the new version of it to having to recode entire sections of their websites.

    Hope that helps.
    Signature

    Services offered: PSD to Wordpress, Joomla, Drupal Templates or Full Site, Custom PHP or C# Programming, Fix problems on any software, and more.

    You will get 25% OFF all services by mentioning the Warrior Forum. PM me here or email me to ivanphp404@gmail.com if interested and/or if you have questions.

    {{ DiscussionBoard.errors[10472699].message }}

Trending Topics