Solved

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

Posted on 2014-01-23
6
416 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
  • 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 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39803396
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 108

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 108

Expert Comment

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

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now