Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'It broke my web apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
It broke my web apps
Authored by: carter on Apr 30, '02 09:30:56AM

I have used Marc's installations of PHP and Mysql in the past and they have worked flawlessly. Yesterday, I upgraded to PHP 4.2.0 using his method on three computers. All of my scripts broke! Now....I am a novice and don't know why this was but it happened. I was able to downgrade, thankfully!
I will try again on a test computer soon. Any thoughts?



[ Reply to This | # ]
PHP 4.2 is different
Authored by: Paul W. Brown on Apr 30, '02 10:08:53AM

The reason why your webapps were "broken" is b/c PHP 4.2 is a whole lot different. The release notes at PHP.net make the point of clairifying that PHP 4.2 uses a differnt syntax - especially regarding varibles, for security reasons. I would go ahead and upgrade and then "patch" your work, if I were you.



[ Reply to This | # ]
PHP 4.2 is different
Authored by: carter on Apr 30, '02 02:24:20PM

Yes, I guessed that it was different....but thanks for your note. I intend to try it on a test system and redo my previous work. I look forward to the chance to learn more about all this.



[ Reply to This | # ]
It broke my web apps
Authored by: deleted_user2 on Apr 30, '02 11:34:35PM
In PHP 4.2.0 global variables are accessed very differently. In previous versions, if you passed in a GET variable to a script it was automatically available everywhere in your script, most old PHP is written based on this assumption. This is no longer the default behavior. One way to fix most of the problems with the new variable structure is to just turn the old way back on. Although you won't have the new added security from PHP 4.2.0, it can offer you a transitional phase while you update your code. To make the old global variable structure work again you just edit your php.ini file in /usr/local/lib (create it if it doesn't exist) and change or add the line: register_globals=on This gives you a chance to change all your $random_get_var to $_GET["random_get_var"] (or just pop something this at the beginning of your code: $random_get_var = $_GET["random_get_var"];). Hope that helps Jeremy Gustie http://www.gustie.com:1313/

[ Reply to This | # ]
It broke my web apps
Authored by: carter on May 01, '02 08:49:58AM

Thank you for this information. I had suspected that my problem was centered around this change (globals) but with my limited knowledge, I was not sure. I also appreciate your help with the temporary fix as well as the recoding help.
Many, many thanks!



[ Reply to This | # ]
It broke my web apps
Authored by: wnixon on Jun 07, '02 05:34:34PM

Regarding, creating the php.ini file. Is there anything else that would need to go into this file other than the one line regarding globals? Will it affect the configuration of php other than the globals?

Thanks, Walt



[ Reply to This | # ]
It broke my web apps
Authored by: wnixon on Jun 20, '02 11:20:12PM

Regarding, creating the php.ini file (which I don't have now). Is there anything else that would need to go into this file other than the one line regarding globals? Will it affect the configuration of php other than the globals?

Thanks, Walt



[ Reply to This | # ]