Solved

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

Posted on 2014-01-23
6
418 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

914 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

14 Experts available now in Live!

Get 1:1 Help Now