PHP register globals and OS X
I’ve got PHP running on my computer (OS X is wonderful that way). Unfortunately my PHP files weren’t sending variables to one another, viz., when foo.php?bar=3
was loaded, the variable $bar
wasn’t picked up. This meant that coding PHP-based web pages locally was a bit problematic.
As usual, Google is my friend. This discussion provided the answer, namely, that register globals were turned off by default as of PHP 4.2.0. (I’m running 4.3.2.) You turn them on again by editing httpd.conf
: add php_admin_flag register_globals on
between <IfModule mod_php4.c>
and </IfModule>
. A restart and hey presto, it works.