turn off register_globals on a shared server

Mike's Avatar
Go4Expert Member
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.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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
0
Mike's Avatar
Go4Expert Member
"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