Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    May 2006
    Posts
    271
    cPanel/Enkompass Access Level

    Root Administrator

    Default Downsides to upgrading to PHP5 / mySQL5?

    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. #2
    Member
    Join Date
    Aug 2007
    Posts
    23

    Default

    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).
    Last edited by gribozavr; 09-22-2007 at 04:12 PM.

  3. #3
    Member
    Join Date
    Nov 2003
    Posts
    67

    Default

    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

  4. #4
    Member Stefaans's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, Canada
    Posts
    445

    Default

    There are also some syntax changes with object oriented code between PHP4 and PHP5 that could cause some (older) applications to break.

  5. #5
    Member
    Join Date
    May 2006
    Posts
    271
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Thanks for the responses / experiences / opinions. There's a lot to consider here...

  6. #6
    Member
    Join Date
    Nov 2003
    Posts
    67

    Default

    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. #7
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    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. #8
    Member
    Join Date
    Nov 2003
    Posts
    67

    Default

    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. #9
    Member bin_asc's Avatar
    Join Date
    Jul 2005
    Posts
    280

    Default

    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. #10
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    11,189
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by trevHCS View Post
    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
    Updated release information for EA3 (Stage 2) can be found on http://www.cPanel.net/cpanel11

  11. #11
    Member
    Join Date
    May 2005
    Location
    Auburn, CA
    Posts
    243

    Default

    Another option is to download XAMPP http://www.apachefriends.org/en/xampp.html, which has both PHP4 and 5, and test your apps/scripts locally.
    cPanel: Latest Release Version [11.32.2.*]
    PHP 5.3.10, Apache 2.2.22, MySQL 5.1.56, Perl 5.8.8, CentOS 6.2

Similar Threads & Tags
Similar threads

  1. How can I use Ruby on rails with mongrel(apache2/php5/mysql5)
    By psdjc in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-25-2007, 12:11 PM
  2. MySQL4.1 or MySQL5 for PHP5
    By anoetic in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-06-2007, 06:23 AM
  3. MYSQL5 & PHP5 update problems
    By Lammypie in forum New User Questions
    Replies: 3
    Last Post: 10-29-2006, 02:31 AM
  4. Need help from an experienced php5/mysql5/Cpanel Expert
    By ricoche in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-30-2006, 04:59 AM
  5. cpanel php5 & mysql5 support
    By glowico in forum cPanel and WHM Discussions
    Replies: 13
    Last Post: 12-28-2005, 03:27 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube