|
|
It broke my web apps
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!
PHP 4.2 is different
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.
PHP 4.2 is different
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.
It broke my web apps
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/
It broke my web apps
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.
It broke my web apps
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?
It broke my web apps
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? |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|