Drupal Installation Problem on Shared Hosting

I ran into a problem on installing Drupal on a shared host server. The problem arises (see error script below) when the installation script hits the php method to check whether register_globals is enabled. For security purposes register_globals needs to be enabled but on some shared hosting this is simply not a feasible option.

register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled.

There are 2 potential solutions I discovered, either create a php.ini file with:

1
<? php set register_globals = Off ?>

and upload to the directory containing your drupal installation. Or create a .htaccess file in the same location containing php_flag register_globals off.

Neither of these worked for one particular shared hosting due to them loading PHP as a CGI module for security reasons.

I did find a work around although I am unsure of the consequences, I discovered that the installation script that runs this particular method is located @ drupal installation folder > modules > system > system.install.

On line 54 is an if statement which you can change from:

($register_globals) != ‘off’) to ($register_globals) == ‘off’).

If anyone is a big Drupal and PHP head then please do not hesitate to feed back to me comments regarding this work around!

Comments