OLD PHP Code vs New Server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

OLD PHP Code vs New Server

Post by facets »

Hi All,

This may seem like a dumb question.. but here goes..
I have inherited some old php code that I need to maintain on a new server. I've got the code running by turning register_globals on. Not the best I know. But the errors logs are still throwing lots of warnings etc. And occasionally something will cause a record not to update. We never had this issue with the older version.

Does anyone have any suggestions apart from a 'proper' code re-write and turning off warning logging etc?

tks, Will/
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: OLD PHP Code vs New Server

Post by Oren »

facets wrote:Does anyone have any suggestions apart from a 'proper' code re-write and turning off warning logging etc?
Is there a third, practical, way?
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Post by facets »

I guess that's the question I am asking.
Like a tweak to the php.ini file for example that I don't know about that perhaps might make ensure php 5 acts like it's pre 4.23.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

facets wrote:I guess that's the question I am asking.
I know, and I was asking it again, but as a rhetorical question... since the answer is probably no.

facets wrote:Like a tweak to the php.ini file for example
That would be turning warnings off :P
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

There's five options:

1. Don't upgrade the server at all. Not really an option I imagine.

2. Upgrade the server hardware, keep all the software the same. (This is what I usually do. I only upgrade to a new version if I really, really have to.)

3. Upgrade the server and try to hack some sort of settings in that appear to work. You'll never be 100% sure the site is working perfectly if you do a quick fix. Definitely not something I'd recommend. But it's the cheap and 'easy' option.

4. Upgrade the server and bug fix like crazy. You don't have to completely rewrite everything if the code works, you just need to fix whatever is throwing the errors. This is the proper solution.

5. Upgrade the server and rewrite the application. It's a solution, but it's pretty daft if you have code you know works elsewhere. You'll probably introduce new problems while you fix old ones.

2 or 4 in my opinion depending on the reason for the server upgrade.
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Post by facets »

tks all!

Yup. Option 4 is what I have done. I've fixed most bugs/features, just a few I can;t nail down.
Post Reply