Go Back   HostGator Peer Support Forums > HostGator Peer Support Forums > Shared Hosting Support

Notices

Reply
 
Thread Tools
  #1  
Old 02-13-2009, 04:01 AM
mtkauff mtkauff is offline
Hatchling Croc
 
Join Date: Jan 2009
Posts: 11
Default register globals question

I am a complete php newbie, so take it easy on me.

I am just starting to build my site and delving into php when I come across the register globals issue. I see that it is set to on. After reading a few threads here I became completely confused. I assume for securities sake that it should be off, but it seems that this causes issues(?)

My site will be a community type site with members, databases, etc. and I want to make sure everything is secure. Do I set the register globals in the root php.ini file to off, or is there another way of doing this? A layman's explanation would be greatly appreciated.

I am wanting to get this right before I start implementing php into my site so I don't have to come back later to change things and possibly screw up any or all scripts I am using.

Mike
Reply With Quote
  #2  
Old 02-13-2009, 04:24 AM
mtkauff mtkauff is offline
Hatchling Croc
 
Join Date: Jan 2009
Posts: 11
Default Re: register globals question

After looking at the root htaccess file, this was in the file:

<IfModule mod_suphp.c>
suPHP_ConfigPath /home/USERNAME/php.ini
<Files php.ini>
order allow,deny
deny from all
</Files>
</IfModule>

Doesn't this turn off the globals?
Reply With Quote
  #3  
Old 02-13-2009, 05:02 AM
striddy's Avatar
striddy striddy is offline
Veteran Croc
 
Join Date: Mar 2008
Location: /home/australia/earth
Posts: 4,093
Default Re: register globals question

Quote:
Originally Posted by mtkauff View Post
I see that it is set to on.
.....
Do I set the register globals in the root php.ini file to off, or is there another way of doing this? A layman's explanation would be greatly appreciated
The easiest way is:

Cpanel > Software / Services > php.ini EZConfig > Enable EZConfig > locate register_globals > select Off > Save Changes > That's it.
__________________
- David
Reply With Quote
  #4  
Old 02-13-2009, 01:43 PM
mtkauff mtkauff is offline
Hatchling Croc
 
Join Date: Jan 2009
Posts: 11
Default Re: register globals question

Yeah, I noticed that striddy, but I was wondering if doing that created any other problems.
Reply With Quote
  #5  
Old 02-14-2009, 03:24 PM
mp3 mp3 is offline
Junior Croc
 
Join Date: Dec 2007
Posts: 167
Default Re: register globals question

Register Globals isn't a security issue itself, but turning it off forces you to write safer code. Turning it off can also break scripts that rely on it.

I suggest that you always write scripts with register globals off, and don't run anything that requires it.
Reply With Quote
  #6  
Old 02-14-2009, 04:03 PM
phototristan phototristan is offline
Baby Croc
 
Join Date: Nov 2008
Posts: 63
Default Re: register globals question

It should really be defaulted to OFF by HostGator like every other reputable host.
Reply With Quote
  #7  
Old 02-19-2009, 12:12 PM
minndan's Avatar
minndan minndan is offline
Hatchling Croc
 
Join Date: Feb 2009
Location: Minneapolis
Posts: 11
Default Re: register globals question

I just looked and didn't see this: php.ini EZConfig

Can I just post an php.ini file and do it myself? I tried, by the way, and it didn't take:

register_globals = off
Reply With Quote
  #8  
Old 02-19-2009, 12:18 PM
minndan's Avatar
minndan minndan is offline
Hatchling Croc
 
Join Date: Feb 2009
Location: Minneapolis
Posts: 11
Default Re: register globals question

Ok, I got it to take. I thought if I put my php.ini file in the public_html folder, it would affect all subfolders. But it didn't seem to? Once I copied that file to the particular folder that needed it, it took.

Doesn't it normally affect all folders underneath it?
Reply With Quote
  #9  
Old 02-19-2009, 05:55 PM
kompreszor's Avatar
kompreszor kompreszor is offline
Swamp Croc
 
Join Date: Jun 2007
Location: Pennsylvania, USA
Posts: 330
Default Re: register globals question

Try putting the php.ini at the ConfigPath location stated in your root .htaccess :-) That's how I have mine set up and it works fine.
__________________
“There is a principle which is a bar against all information, which is proof against all arguments and which cannot fail to keep a man in everlasting ignorance—that principle is contempt prior to investigation.”
—Herbert Spencer
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and Register Globals Unregistered Pre-Sales Questions 27 08-18-2010 05:59 PM
Register Globals SurfBum Shared Hosting Support 11 09-16-2008 10:14 PM
Register Globals andrewtayloruk Shared Hosting Support 5 02-15-2008 11:58 AM
Register Globals on .htaccess file nelo Shared Hosting Support 2 07-03-2006 09:10 AM
Register Globals: On or Off? kissmedeadly Shared Hosting Support 2 02-15-2006 06:54 PM

All times are GMT -5. The time now is 03:15 AM.