Solved

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

Posted on 2014-01-23
6
423 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

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!

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
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

761 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