|
|||
|
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! |
|
|||
|
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. |
|
|||
|
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 |
|
||||
|
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 |
|
|||
|
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 |
|
||||
|
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.
__________________
Various Topics - Get your information |
|
|||
|
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 |
|
||||
|
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.
__________________
Various Topics - Get your information |
|
||||
|
Quote:
__________________
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 |
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|