Welcome to WebmasterWorld Guest from 54.145.39.186

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Going from PHP 4 to PHP 5

Are there any issues

     

adb64

7:46 pm on Oct 12, 2008 (gmt 0)

10+ Year Member



My host wants me to go from a server with PHP 4 to one running PHP 5. All the scripts on my site are running fine on PHP 4. Can I expect any issues when running the same scripts on PHP 5? What things should be modified before the conversion so the site will run smoothly after the transition?

Thanks,
Arjan

Rosalind

9:17 pm on Oct 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It all depends on the scripts. There are a few issues, notably because register_globals is off by default in 5. It could cause problems, but it really depends on when your scripts were created and what versions they're for.

PHP is currently on version 6, so if you're running the latest versions of everything, as you should be for the best security, then I doubt you'll have problems. If they're custom scripts then it could be a bit of a headache.

Anyango

9:37 pm on Oct 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Non OOP php4 scripts tend to have less problems in migration than php4 scripts with Object Oriented Style coding

So if your scripts are OOP Paradigm then do some further research before making the move.

[edited by: Anyango at 10:21 pm (utc) on Oct. 12, 2008]

dreamcatcher

7:44 am on Oct 13, 2008 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Might be worth setting up a local server with PHP5 to see what happens.

dc

mrscruff

9:05 am on Oct 13, 2008 (gmt 0)

5+ Year Member



I would set up a local server running php5 and test it. If your scripts were written properly you should not have may problems.

The one to watch out for the the xml functions as these have been rewritten, for the best, so have to change the way xslt is applied to xml. This is quick, I had to do it, just put in a version check for when we upgrade so the script will work on either PHP4 or PHP5.

As always it is best to read all the documentation about the upgrade on the php website, and use something like agent ransack to check your scripts for any references to functions that may have changed or been deprecated.

tomda

10:08 am on Oct 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Main issue I had was :

<? is no longer valid in PHP5 and should be changed with <?php (or you can change setting in your Apache also)

adb64

11:03 am on Oct 13, 2008 (gmt 0)

10+ Year Member



Thanks everyone for the input. This will give me some pointers to check before I do the transition to the other server.

dreamcatcher

7:13 pm on Oct 13, 2008 (gmt 0)

WebmasterWorld Senior Member dreamcatcher is a WebmasterWorld Top Contributor of All Time 10+ Year Member



<? is no longer valid in PHP5 and should be changed with <?php (or you can change setting in your Apache also)

Thats a little incorrect tomda. Short tags work fine in PHP5. They aren`t enabled by default. Just enable them in your PHP.ini file.

dc

tomda

5:24 am on Oct 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your correction DreamCatcher !
I really though it was enable by default.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month