The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Downsides to upgrading to PHP5 / mySQL5?

Discussion in 'General Discussion' started by Metro2, Sep 22, 2007.

  1. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    I'm currently running with mysql 4.0.27-standard and php 4.4.7 , and I was just wondering if there are any downsides to upgrading to 5.x on both, and if it matters which version of apache I'm running (this is on RHEL 3 and 4 boxes).

    Thanks for any tips / advice / opinions!
     
  2. gribozavr

    gribozavr Member

    Joined:
    Aug 15, 2007
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    Yes, there are problems with character encodings when updating from MySQL 4.0 to 4.1+. MySQL starting from 4.1 demands every script to tell it in what encoding it sends/receives data. Everything seems OK with Latin alphabet, but national alphabets, for example, Russian in CP1251 encoding, is displayed as ???.

    The fix was to add after every mysql_connect()
    mysql_query("set names cp1251;");

    It had to be done for every client's website which had Russian text in the database and didn't explicitly declare encoding (most average PHP programmers don't know about this issue and just ignore the encoding problem).
     
    #2 gribozavr, Sep 22, 2007
    Last edited: Sep 22, 2007
    Metro2 likes this.
  3. trevHCS

    trevHCS Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    69
    Likes Received:
    1
    Trophy Points:
    8
    The only things I found with PHP5 were:-

    - array_merge() throws errors if you send it only 1 array. In PHP4 is simply outputted the first array again, but in PHP5 it throws a warning and can mess things up.

    - Watch out if you do any include("http://www.example.com/script.php"); type calls, you need to add a new line to php.ini which is: "allow_url_include = On". Without this URL calls in include() won't work.

    - Finally, be careful with function calls. In PHP4 if you declared a function twice then it just seemed to ignore this, but in PHP5 it doesn't and it'll fall over. I assume if you run your scripts with error_reporting(E_ALL); set then these will show in PHP4, but this can be a pain in 3rd party scripts too.


    It's probably also a good idea to go into PHP Config Editor in advanced mode and just save it as that seems to fill in some of the blanks and missing bits. However if you do that you'll probably need to edit php.ini (usually at /usr/local/lib/php.ini ) and sort out the error_reporting line.

    The editor messes this up and will write it as...
    error_reporting = "E_ALL & ~E_NOTICE"

    ...whereas it should be that without the quotes...
    error_reporting = E_ALL & ~E_NOTICE


    Trev
     
    Metro2 likes this.
  4. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    There are also some syntax changes with object oriented code between PHP4 and PHP5 that could cause some (older) applications to break.
     
  5. Metro2

    Metro2 Well-Known Member

    Joined:
    May 24, 2006
    Messages:
    376
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    Thanks for the responses / experiences / opinions. There's a lot to consider here...
     
  6. trevHCS

    trevHCS Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    69
    Likes Received:
    1
    Trophy Points:
    8
    One option depending on the complexity of your sites is to find a host who's running PHP5 and open an account with them, then test it. Admittedly this is easier said than done depending on configs etc. but might allay any worries about it all going bang.

    Trev
     
  7. bin_asc

    bin_asc Well-Known Member

    Joined:
    Jul 18, 2005
    Messages:
    280
    Likes Received:
    0
    Trophy Points:
    16
    A step to upgrade to php5 is needed, as support will be bailed out on PHP4 ... so better to have your clients upgrade from now than when php4 is totally unsuported. Maybe do a combo php4 and 5 install and clients can use .htaccess directives to use php5 as default, in case they want to test the scripts.
     
  8. trevHCS

    trevHCS Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    69
    Likes Received:
    1
    Trophy Points:
    8
    Can you do the split PHP4 + 5 currently except on the less reliable builds? I've heard on here that it's coming in the stable and release builds, but not sure exactly when and there seem to be a lot of people having problems with some of the "current" ones.

    Wish I'd thought of that however before doing it... :)

    Trev
     
  9. bin_asc

    bin_asc Well-Known Member

    Joined:
    Jul 18, 2005
    Messages:
    280
    Likes Received:
    0
    Trophy Points:
    16
    There are tutorials here on cPanel on how to do the combo. You don`t really need EA3 to do it. Search on the forum.
     
  10. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Updated release information for EA3 (Stage 2) can be found on http://www.cPanel.net/cpanel11
     
  11. MaraBlue

    MaraBlue Well-Known Member

    Joined:
    May 3, 2005
    Messages:
    335
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Carmichael, CA
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page