Author Topic: PHP4 on PHP5 server  (Read 1259 times)

Offline Zeggy

  • Global Moderator
  • Level 35
  • *****
  • Posts: 1,187
  • Reputation: +13/-4
    • View Profile
PHP4 on PHP5 server
« on: March 06, 2008, 01:33:25 PM »
I'm just wondering, since I never got a definitive answer to this question.

Is there any circumstance where a PHP4 script would not work on a PHP5 server?

Offline Rimmy

  • Level 12
  • *
  • Posts: 80
  • Reputation: +1/-0
    • View Profile
Re: PHP4 on PHP5 server
« Reply #1 on: March 06, 2008, 03:27:51 PM »
Aren't these things usually backwards compatible?

Offline danielOut

  • Level 6
  • *
  • Posts: 22
  • Reputation: +0/-0
    • View Profile
    • fiftycal
Re: PHP4 on PHP5 server
« Reply #2 on: March 06, 2008, 03:50:39 PM »
-danielOut

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: PHP4 on PHP5 server
« Reply #3 on: March 07, 2008, 08:37:59 AM »
Also, be sure to check the php.ini settings for the new server as some of your code may have been dependent upon it. For example, if you're used to register_globals being turned on or perhaps you're using utf-8 encoding but you've been coding your string handling using the basic handlers due to the ini setting aliases for those functions to the mbstring functions.
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: PHP4 on PHP5 server
« Reply #4 on: March 08, 2008, 05:56:49 AM »
Yes, it happens to me once. Do not remember what it was exactly, but it was connected to handles or references. It was only one problem in a whole gamescript and it was partially due to my improper code (PHP5 is more strict than PHP4). So I would say such occurences are rare and swithing to PHP5 would be without problems in 99% of cases.

Offline Boozerbear

  • Level 3
  • *
  • Posts: 7
  • Reputation: +0/-0
  • Why should Kirk get all the hot green alien chicks
    • View Profile
    • Secret Society Wars
Re: PHP4 on PHP5 server
« Reply #5 on: May 18, 2008, 10:04:44 AM »
I'm just wondering, since I never got a definitive answer to this question.

Is there any circumstance where a PHP4 script would not work on a PHP5 server?

well, not so much "not work" as "works in an unexpected manner".

The two things I had to deal with is the changes in MySQL: namely a change in the format of the TIMESTAMP field and the fact that now *all* integer-type fields have a tendency to roll over to max value if you set them to UNSIGNED and subtract from the value to get a result that's negative. This previously only occurred with BIGINT fields, but now they all do it.

PHP4 to PHP5 was no problem. MySQL 4 to MySQL 5 was a bit more challenging. (:

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal