Solved

Best way to remove global variables so we can upgrade to php 5.4

Posted on 2014-01-23
6
424 Views
Last Modified: 2014-01-24
Hello,
We are running PHP 5.3.3 and want to upgrade to PHP 5.4.23.
We tried it last night but quickly rolled back because it caused our sites to not load.
We were told (by Rackspace or Dedicated Server Provider) it is because we use global variables and they are no longer supported in 5.4.

Is there an easy way to track down where the global variables are?
Or some code that you can add that somehow converts them?

Or is this one of those things that you need to go through every page of your website and do it manually?

Thank you in advance for your advice.
0
Comment
Question by:Razzmataz73
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:ienaxxx
ID: 39803195
Do you mean that you use REGISTER_GLOBALS in the PHP ini?

can't believe, but i think global declarations (like "global $varName") should always work fine even with the newest versions of PHP...

If i were you i'd use notepad++'s function to searc in multiple files with regexp.
Hope this helps.
0
 

Author Comment

by:Razzmataz73
ID: 39803206
I will ask them to clarify.
This is what they said in our ticket:

It looks like these sites are coded using global variables which have been completely removed by php 5.4. Therefore the server didn't recognize the structure of your site and in turn wouldn't display the page. We also looked at the error logs and it was showing lots of undefined variables.

The mysql upgrade went smooth so you are now running mysql 5.5. In order to properly upgrade php, the sites that contain global variables would have to be redeveloped for php 5.4.

If you have any more questions, feel free to update this ticket or call anytime. We're always glad to do what we can to assist you!
0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39803396
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39807179
Thanks for the points.  Good luck with the upgrade! ~Ray
0
 

Author Comment

by:Razzmataz73
ID: 39807591
Thanks Ray,
As always you are a GREAT HELP!
:)
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39807680
That's only because I make more mistakes than anyone else ;-)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question