Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-01-23
6
Medium Priority
?
431 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 111

Accepted Solution

by:
Ray Paseur earned 2000 total points
ID: 39803396
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 111

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 111

Expert Comment

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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
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 dynamically set the form action using jQuery.

688 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