#1 (permalink)  
Old 09-22-2007, 03:30 PM
Registered User
 
Join Date: May 2006
Posts: 185
Metro2 is on a distinguished road
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-22-2007, 04:07 PM
Registered User
 
Join Date: Aug 2007
Posts: 23
gribozavr is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-22-2007, 05:53 PM
Registered User
 
Join Date: Nov 2003
Posts: 60
trevHCS is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-22-2007, 07:47 PM
Stefaans's Avatar
Registered User
 
Join Date: Mar 2002
Location: Vancouver, Canada
Posts: 444
Stefaans is an unknown quantity at this point
There are also some syntax changes with object oriented code between PHP4 and PHP5 that could cause some (older) applications to break.
__________________
Stephen @ ANNO Internet
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-24-2007, 09:19 PM
Registered User
 
Join Date: May 2006
Posts: 185
Metro2 is on a distinguished road
Thanks for the responses / experiences / opinions. There's a lot to consider here...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-25-2007, 04:15 AM
Registered User
 
Join Date: Nov 2003
Posts: 60
trevHCS is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-25-2007, 06:51 AM
bin_asc's Avatar
Registered User
 
Join Date: Jul 2005
Location: Romania
Posts: 277
bin_asc is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-25-2007, 07:40 AM
Registered User
 
Join Date: Nov 2003
Posts: 60
trevHCS is on a distinguished road
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-25-2007, 07:52 AM
bin_asc's Avatar
Registered User
 
Join Date: Jul 2005
Location: Romania
Posts: 277
bin_asc is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 09-25-2007, 09:08 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
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
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 09-26-2007, 09:33 PM
Registered User
 
Join Date: May 2005
Location: Auburn, CA
Posts: 206
MaraBlue is on a distinguished road
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.
__________________
11.25.0-R42404
PHP 5.2.11, Apache 2.2.13, Perl 5.8.8, CentOS 4.8
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:26 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc