places where register_globals can be set Story for background problem: I have a hostgator account. Uploaded the content of a drupal install folder to the actual root of the server. To fix this, I deleted all the files that I recognised from the drupal installation folder. The hostgator person on the chat reassured me that by default the .htaccess file is empty so going to back to an empty would bring me back to the original state. 
Everything seemed fine

Until I wanted to update 1 drupal 7 installation from 7.17 to 7.18. when starting to run mysite.com/update.php it said

  PHP register globals  Enabled ('1')
register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled. The PHP manual has instructions for how to change configuration settings.


Checked the cpanel's php quickconfig settings. This said register_globals was set to off. So that means this setting is overwritten somewhere on a deeper level (it's a shared server so the root of my server is at a deeper level than the php installation which I obviously can't touch).
There IS a php.ini file in my root folder of my server but that one also says

register_globals = Off


I looked up this problem and a lot of people seem to solve this by settings the register_globals to off in the places I mentioned. I also put a php.ini file in my drupal installation folder at the same level as my index.php file. This solved the register_global problem, but then I started getting errors about the PDO not being compatible with my current php version (5.2.13 while PDO would be needing 5.2.4 and up). And I don't think asking my provider to update php would be the way to go....
I have hostgator account too.
In hostgator and certain other host providers the php.ini that overrides the default values should live in /home/USER/ (i.e. check if /home/USER/php.ini exists, where USER is the username of your hosting account). Make sure that this file has register_globals = Off.

If /home/USER/php.ini is not there then either copy the default (if you have shell access check php.ini location with the command php -i | grep php.ini and then copy this file to /home/USER/php.ini) or ask tech support to help.

More details can be found here on HostGator support site.

Finally, if you are using drush on your host account you might encounter "Register globals detection" issue in which case I would suggest the solution in comment #6, i.e.

cd drush/
ln /home/USER/php.ini php.ini


the resason for this is that drush script (drush/drush) checks for drush/php.ini and if it does not find it there it detects the default php.ini not the /home/USER/php.ini one.