Drupal 6 Installation issues
Oct 1, 2009 Drupal, techno-babble
Drupal 6 requires php directive “register_globals” to be off. This is not always the case depending on your hosting environment or even your own requirements as Drupal may not be the only thing residing on your virtual server.
There are several work arounds for the issue if you come across an error during installation asking you to turn “register_globals” off. It may work for you or it may not work for you, but the final one will definitely do the job. Just to be safe, try the fixes in the order below:
1. You can always add or edit the .htaccess file in your root directory with the following line:
php_flag register_globals off
This may or may not work depending on whether the apache configuration on your host allows directives to be fed through the .htaccess file. Find out more about .htaccess files by going to http://www.freewebmasterhelp.com/tutorials/htaccess/
2. So that didn’t work huh? Fret not, here’s another solution. Place a “php.ini” file in your root directory with the following line:
register_globals = 0
did that work? Basically you are telling php to initialize with the setting for your directory.
3. Wait, we didn’t cover the fact that you may be running your own server! Well if you are lucky enough to have your own server and control over your php.ini file, simply change the register_globals variable to ‘off’ in your php.ini file. More information can be found at the php website about how to configure your php.ini file.
4. You could also try adding the following line to your .htaccess file (it has been proven to work on 1&1 webservers):
AddType x-mapp-php5 .php
This directive simply tells the server to use php5 for .php files instead of php4 (which might be the default for several webhosts out there)
5. Ok genius, nothing worked, now what? Yup, that was my case as well, nothing worked, seemed the host didn’t allow default settings to be changed. Well there’s always the “ask your hosting provider” answer. If you are so inclined to do so, send them an email and ask them how to turn the “register_globals” variable off for your particular site. They might not be of much help, but you never know. Or, (Yes!) there’s another method. You can simply tell Drupal to ignore it when installing. It requires you to change the install file located in modules/system directory called “system.install“. Go ahead and find the line:
if (!empty($register_globals) && strtolower($register_globals) != ‘off’)
and change the “!=” to “==” . The line should now read:
if (!empty($register_globals) && strtolower($register_globals) == ‘off’)
Curious to know what you are doing here? Well you are simply telling the system.install file change the “not equal to” to “equal to”. Basically, you fooled the system into treating a response which would mean that “register_globals” is “on” into treating it as “register_globals” is “off”. You will not get any more errors when doing the install now.
Now, remember, it is unsafe to have register_globals on. Your system is not fully secure if that directive is on. So if you are willing to take the risk, you can implement the solutions provided in this post.
Tags: Drupal




Leave a Reply
You must be logged in to post a comment.