1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

turn off register_globals on a shared server

Discussion in 'PHP' started by Mike, Jul 27, 2005.

  1. Mike

    Mike New Member

    Joined:
    Oct 19, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    Hello All,

    My shared server provider has register_globals on. I checked by running php_info(); from within a file. I would like to turn this off, but asking them to turn it off just for me will not work.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    register_globals server variable values cannot be set with the help of ini_set function but Entry can be set in php.ini, .htaccess or httpd.conf

    So just put the following lines in .htaccess file
    php_flag register_globals off
    php_flag safe_mode on
    Options -Indexes

    But for some reason it causes 500 Error on some hosts but not all.

    So the better option is to put the php.ini file in your home directory PHP always checks for php.ini in the root of the document before it
    checks elsewhere.

    Thanks
    Shabbir Bhimani
     
  3. Mike

    Mike New Member

    Joined:
    Oct 19, 2004
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    0
    Home Page:
    "So the better option is to put the php.ini file in your home directory PHP always checks for php.ini in the root of the document before it checks elsewhere. "
    That will help
     

Share This Page