register_globals requirement

alloplastic - November 17, 2008 - 19:19

Hi, I'm trying to install Drupal in a shared hosting environment under Windows. The installating fails due to the PHP setting "register_globals" being set to 1.

I don't believe that I will be able to modify the Windows registry to alter this property. Is there any other way to work around the problem?

Here is a comment from my hosting provider. Will this suggestion allow me to complete the Drupal installation process? Failing that, is there any way of circumventing this particular requirement?

-----

On Windows, register_globals is On. A user on Windows cannot turn off register_globals, however,
you can use this code to accomplish the same effect:

if (ini_get('register_globals')) {
foreach($GLOBALS as $s_variable_name => $m_variable_value) {
if (!in_array($s_variable_name, array('GLOBALS', 'argv', 'argc', '_FILES', '_COOKIE', '_POST', '_GET', '_SERVER', '_ENV', '_SESSION', '_REQUEST', 's_variable_name', 'm_variable_value'))) {
unset($GLOBALS[$s_variable_name]);
}
}
unset($GLOBALS['s_variable_name']);
unset($GLOBALS['m_variable_value']);
}

-----

Thanks,
alloplastic

I've no clue if there's any

WorldFallz - November 18, 2008 - 02:33

I've no clue if there's any way around it, but either your host is clueless or they're lying to you. register_globals is a php setting, it has nothing to do with windows. I have register_globals off on my windows dev site no problem.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

ummmm, wheres that code go??

cdcaveman - November 23, 2008 - 15:56

i'm on gearhost. similar problem, tried .htacess php.ini and i can't change it! i'm oging ot put this snippit everywhere i can think and see if i can work around it

 
 

Drupal is a registered trademark of Dries Buytaert.