DrupalDilatant: Getting rid of Dreaded Register_Globals Error During Drupal Updates and Installations

I think it was as of Drupal 5 that I started getting register_globals error whenever I tried to do a manual install (not through Fantastico) or update database after install by running update.php file residing in the root of drupal install directory.

The error simply says that register_globals is enabled on php running on your server and it should be disabled before Drupal update.php could proceed.

First, if you really want to know if register_globals is really enabled (and Drupal is not mistaken), create a file called phpinfo.php containing the following code, upload it to your root and execute it by going to its URL in your browser, i.e. www.example.com/phpinfo.php .

This will give you know a million things about the php environment of your server, including the status of register_globals.

To turn off register_globals, I create php.ini file (just a text file and rename it) and inside I put in:

register_globals = Off

I then upload it to the root and the install directory of drupal (if it happens not to be the root).

That’s it. After that, Drupal update.php lets the process continue.

This works for me because my host does allow custom php.ini files. Not all hosts allow that.

More info: http://drupal.org/node/212062

DISCLOSURE: I am NOT a Drupal expert. My posts about Drupal are meant to impart how-to info in plain English on methods that have worked for me. My target audience is people who, like myself, use Drupal as just one of the tools to leverage the Web — hence the name DrupalDilatant.