Drupal register_globals problem

Have you tried to install Drupal, and got a message saying your server environment is unsupported because you have register_globals turned on? Have you been unable to change this because your web host (1&1, in my case) doesn’t let you play with PHP’s settings (and quite right too)?

Help is (possibly) at hand! It’s likely that although you can’t configure PHP directly, your host will allow per-directory PHP configuration changes. You do this with a plain-text file called php.ini, which in this case is placed in the root directory of your Drupal install, and contains just one line:

register_globals = off

Hurrah, eh? You can thank me with beer.

25 Comments

Filed under howto

25 Responses to Drupal register_globals problem

  1. OMG, its help me so much… thaaaaaaaaaaaaaanks!!!!!

  2. Thank you very much, it’s really efficent.
    and ok for the beer (or french wine bottle : it’s better)

    Thierry

  3. THANKS!!!!! 2 beers for YOU MEN!!!

    :)
    Pablo

  4. Perfect!!! I was about to give up on Drupal….Good show ol’ man!

  5. Webplate

    If you’re at 1&1, try putting in the “.htaccess” file at drupal’s root:

    #Forcer PHP5 chez 1and1
    AddType x-mapp-php5 .php

    As PHP5 has “Register Globals” set to 0 by default at 1&1 !

  6. Luco

    thanks. I had some beer but drank all of it. wanna wait around ’till it comes back? LOL

    but thanks, really.

  7. Has anyone tried this on Yahoo web hosting? Yahoo does not allow .htaccess file and creating the php.ini file did not make any difference for me.

    -peeds

  8. deKay

    peeds:
    Have you contacted Yahoo about your problem? They may be able to suggest something.

  9. peeds

    can you provide a link to main page for the yahoo web hosting you are using?
    can you go over the process you are using?

    I am curious to get this working for different providers, it shouldn’t be that hard!

  10. I contacted Yahoo, and at the moment, there is no solution for this. Details in my post:
    http://blog.technicalley.com/index.php/drupal-installation-problems-with-yahoo-sb-web-hosting
    -peeds

  11. Peeds, I am using a very affordable (the cheapest) linux webhosting solution from 1&1,
    and Webplate’s solution above is the best… I added that line at the top of the default drupal .htaccess file

    it looks like some of the basic options available in this situation are outlined here:
    http://faq.1and1.com/scripting_languages_supported/php/18.html

    look at it this way peeds, the support team says you cannot change the register_global to off…

    well fine, but is there any way like webplates to just force the use of php5.0+ which defaults register_global to off?

  12. Patrick Britton

    In a completely non-gay way, I love you! I’ve been trying to get this changed for awhile and this worked. Thanks.

  13. Jake G.

    Thanks a bunch, you probably solved me a TON of time; and to edit additional PHP parameters, insert a line break (press ‘Enter’) and type the next one out, using the same syntax as the first.

  14. G-Fiti

    Thank you so much, you helped me a lot. =)

  15. Bruno

    That was very helpful!!!
    Many thanks :)

  16. amor

    you are the man !!

  17. Gustavo

    Thanks a million!!! you deserve a case of your favorite beer, man.

  18. seedy

    I have an account on ohost.de with register_globals enabled. So i tried this but it has no effect. Drupal is installed in the root folder – could it be a reason for this?

  19. deKay

    Seedy:
    Unfortunately, some webhosts deny the use of php.ini files, so you’d need to speak to their technical support.

  20. Nuwan

    Thanks Mate, works like a charm!

  21. Bart

    After lots of Googling & grumbling about this issue, saw this post & WHAMMO – it works for me.

  22. woo

    nice trick… now the drupal installetion is telling me to increas my memory to 16M. how the make that on 1and1 hosting

  23. sak

    works for drupal installations on godaddy

  24. lisa

    This saved me too today, thanks so much.

  25. Jason

    Thank you! Worked like a charm!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>