#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    Register Globals on my new dev server! AACK!


    I just migrated my dev sever from a Windows Apache set up to an Ubuntu Apache set up with php5.

    I have about 100 files that depended on on register_globals being On in the windows environment as this is a major dev project.

    I cannot for the life of me enable this on the Ubuntu server.

    I have:
    "register_globals = On" in /etc/php5/php.ini
    "ini_set('register_globals', 'On');" in one of my files to test

    NOTHING!!!!
    register_globals doesn't even show up in my phpinfo()

    please help. there is no way I can go and change ALL the vars (about 500 of them) until the dev is done.
  2. #2
  3. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    ini_set() won't work for this setting.

    What version of PHP are you using?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    PHP Version 5.4.6-1ubuntu1.1


    PHP Version 5.4.6-1ubuntu1.1
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,301
    Rep Power
    7170
    register globals does not exist in php 5.4
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2
    okay,
    so now what?
    downgrade until i'm ready for production?
    surely there is a better option.
    r
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,301
    Rep Power
    7170
    Honestly, the best option is to fix your code. Why would you wait until you're ready for production before fixing it? What if you discover other incompatibilities with modern versions of PHP after you fix the register globals problem?

    I understand it's a major project. What I don't understand is why you started a major project that relies on register globals. Register globals has been disabled by default and its use actively discouraged for the past 11 years and it has been officially deprecated for the past 3 years.

    Otherwise, you can downgrade to PHP 5.3, which is the last version of PHP that will ever support register globals.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    agreed


    but the downgrade is temporary because i need to allocate my time to actual development. i will make the code conform in a few weeks when some time frees up.
    thanks guys.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    pear


    problem is i get pear to work with the downgraded version.
    need ANOTHER temporary fix.
    how can install pear to work with 5.3 for a week or two untill i can get this all hammered out?
    r
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    tools tgo fix old scripts


    so are there any suggestions or tools that could help me sort through all of the code and help to find the vars that need to be adjusted?
  18. #10
  19. Come play with me!
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,749
    Rep Power
    9397
    Besides running the code and looking for undefined variable warnings?

    NetBeans, for one IDE, can analyze the code and show warnings when you use an undefined variable.
  20. #11
  21. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,301
    Rep Power
    7170
    It might also be worthwhile searching for <input> and <select> tags in your HTML; those will help identify which variables need to be tested.

    Also make sure you have the dev copy of the site set to show E_NOTICE's; that way anytime you attempt to use a non-registered global you'll get an error message and will know that it needs updated.

    The IDE suggestion is good one too. I haven't used NetBeans, but I'm pretty sure Eclipse can do this as well.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    35
    Rep Power
    2

    just about done


    modifying all essential pages. just decided to bite the bullet and comply. so much for sleeping this weekend.

    having major PEAR issues, will issue a new thread shortly for assistance.

    thanks my friends.

IMN logo majestic logo threadwatch logo seochat tools logo