Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 07-19-2005, 06:54 AM
Unregistered
HostGator Guest
 
Posts: n/a
Default PHP and Register Globals

I have one question that I could not find a existing anwser to. Does HostGator run their servers with PHP Register_Globals on or off? One of the sites that I would like to move to a new host has a PHP MySQL backend script which needs the setting on to run.
Reply With Quote
  #2  
Old 07-19-2005, 01:27 PM
Stef's Avatar
Stef Stef is offline
Royal Croc
 
Join Date: May 2004
Posts: 715
Default Re: PHP and Register Globals

Hi,

register_globals is ON.
In case you ever want it to be off, you can add this line to your .htaccess file:
php_value register_globals 0

Stef.
Reply With Quote
  #3  
Old 07-19-2005, 02:07 PM
Unregistered
HostGator Guest
 
Posts: n/a
Default Re: PHP and Register Globals

Thank you for the reply. With past hosts I always considered a forum reply within 24 hours a minor miracle. I will at the very least give HostGator a try.

Staren
Reply With Quote
  #4  
Old 07-19-2005, 02:10 PM
GatorJay
HostGator Guest
 
Posts: n/a
Default Re: PHP and Register Globals

Forums are also more community based help, if you ever need something that is an emergency be sure to email us (usually answered within the hour) or use livechat instead.
Reply With Quote
  #5  
Old 07-19-2005, 02:58 PM
Unregistered
HostGator Guest
 
Posts: n/a
Default Re: PHP and Register Globals

Quote:
Originally Posted by GatorJay
Forums are also more community based help,if you ever need something that is an emergency be sure to email us (usually answered within the hour) or use livechat instead.
Quite true. That is the reason I posted the question here rather then via e-mail or chat. It was something that did not 'have' to be answered by a rep, and wasn't time critical. It was also something I figured another visitor of the forum might find useful. Anyway, thanks again.

Staren
Reply With Quote
  #6  
Old 07-19-2005, 03:09 PM
GatorJay
HostGator Guest
 
Posts: n/a
Default Re: PHP and Register Globals

Yes, just meant for future of course.
Reply With Quote
  #7  
Old 01-16-2007, 01:11 PM
TWDesigns TWDesigns is offline
Hatchling Croc
 
Join Date: Oct 2006
Posts: 12
Default Re: PHP and Register Globals

Has this changed? Adding this to .htaccess produces an internal page error for me. Joomla 1.12.

Without it everything works. But for Security reasons I want it disabled.
Suggestions?
Reply With Quote
  #8  
Old 01-16-2007, 01:17 PM
quietFinn's Avatar
quietFinn quietFinn is offline
Veteran Croc
 
Join Date: Feb 2005
Posts: 3,475
Default Re: PHP and Register Globals

Quote:
Originally Posted by TWDesigns View Post
Has this changed? Adding this to .htaccess produces an internal page error for me. Joomla 1.12.

Without it everything works. But for Security reasons I want it disabled.
Suggestions?
The server you are in is using phpSuExec, and that means that you can't use .htaccess to change php settings, you must php.ini instead.
Look here: http://forums.hostgator.com/showthread.php?t=8822
__________________
quietFinn - netFinn Finland
"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind." - Dr. Seuss
Reply With Quote
  #9  
Old 03-20-2007, 12:05 PM
cainan cainan is offline
Hatchling Croc
 
Join Date: Aug 2006
Posts: 1
Default Re: PHP and Register Globals

Quote:
Originally Posted by Stef View Post
Hi,

register_globals is ON.
In case you ever want it to be off, you can add this line to your .htaccess file:
php_value register_globals 0

Stef.
I am concerned that my Fantastico installed Joomla has a security vulnerability due to the glaring warning

Following PHP Server Settings are not optimal for Security and it is recommended to change them:
  • PHP register_globals setting is `ON` instead of `OFF`
I tried your suggestion on another host_onster server and it works fine.

Unfortunately my lovely Hostgator space wont do the same. Please post the clues or directions to the missing link..*

We would rooly like to resolve this long standing issue

Many thanks,

Love live hostgator
Reply With Quote
  #10  
Old 03-20-2007, 12:24 PM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: PHP and Register Globals

Your server will likely be using PHPSuExec so a .htaccess override will not work you will need to use php.ini and as quietFinn said.. go to http://forums.hostgator.com/showthread.php?t=8822
Reply With Quote
  #11  
Old 03-20-2007, 02:57 PM
Stef's Avatar
Stef Stef is offline
Royal Croc
 
Join Date: May 2004
Posts: 715
Default Re: PHP and Register Globals

Quote:
Originally Posted by _Sam_ View Post
Your server will likely be using PHPSuExec so a .htaccess override will not work you will need to use php.ini and as quietFinn said.. go to http://forums.hostgator.com/showthread.php?t=8822
Sam's right, that's most likely it.
You can verify if your server is using PHPSuExec by looking at the line with "Server API" in the phpinfo() ouput. If it says "CGI" then your server is using PHPSuExec.

Stef.
Reply With Quote
  #12  
Old 06-23-2007, 10:25 PM
spidro spidro is offline
Hatchling Croc
 
Join Date: Jun 2007
Posts: 3
Default Re: PHP and Register Globals

Quote:
Originally Posted by _Sam_ View Post
Your server will likely be using PHPSuExec so a .htaccess override will not work you will need to use php.ini and as quietFinn said.. go to http://forums.hostgator.com/showthread.php?t=8822
i'v the same problem here i'm running CMS /joomla
and i need to turn off register global , as i read my server is using PHPSuExec so i can't change register global at the htacces file

so how can i change it in php.ini??
Reply With Quote
  #13  
Old 06-24-2007, 01:25 AM
charlesgan's Avatar
charlesgan charlesgan is offline
Swamp Croc
 
Join Date: Mar 2007
Location: http://www.hostgatorreview.org/
Posts: 372
Default Re: PHP and Register Globals

yup.. you can have the register global, .htaccess overwrite, and redirection.

for php.ini.... look at the folder where you run the php from. if not have it, you need to copy the php.ini from your account public_html/.
and in the php.ini, find the line "register_globals".. set the setting to ON.
__________________
Charles Gan
Hostgatorreview.org
Reply With Quote
  #14  
Old 06-24-2007, 04:49 AM
Impavidus Impavidus is offline
Junior Croc
 
Join Date: Feb 2006
Posts: 155
Default Re: PHP and Register Globals

Quote:
find the line "register_globals".. set the setting to ON.
Quote:
i need to turn off register global
You mean setting register_globals to OFF or 0.
Reply With Quote
  #15  
Old 06-24-2007, 10:11 AM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: PHP and Register Globals

When you php.ini override like that, the php.ini file must be in EVERY directory where php code is present. (Or a symlink to the php.ini)

Search the forum, there are at least 50 solutions listed.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #16  
Old 06-24-2007, 07:56 PM
codesight codesight is offline
Swamp Croc
 
Join Date: Jan 2007
Location: Fargo, North Dakota
Posts: 320
Default Re: PHP and Register Globals

FWIW, being a co-author of popular PHP books... I really wish register_globals could be turned off by default on hosts... I know this isn't feasible as it'd cripple most scripts, but it is a huge vulnerability and should be handled accordingly... It is disabled by default in PHP versions from 4.XX on...


Obviously, if you have access to PHP.ini, you can turn this off, and this is the best solution as reading .htaccess files isn't always the best solution overall. It isn't a huge performance hit, but the more "hoops to jump" always creates slowdown.
__________________
http://www.codesight.net
Reply With Quote
  #17  
Old 08-24-2008, 08:51 AM
ccleontez ccleontez is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 5
Default Re: PHP and Register Globals

i created a .htaccess file and included php_value register_globals 0

and i get the following error when i want to install one of my script:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, xxxxxsh.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.



Can you advice me what to do next?
thank you,

-cristian
Reply With Quote
  #18  
Old 08-24-2008, 09:11 AM
kmaw's Avatar
kmaw kmaw is offline
Emperor Croc
 
Join Date: Mar 2005
Location: Ontario, Canada
Posts: 1,921
Default Re: PHP and Register Globals

which server are you on?
Reply With Quote
  #19  
Old 08-24-2008, 09:12 AM
GvilleRick's Avatar
GvilleRick GvilleRick is offline
Emperor Croc
 
Join Date: Jan 2007
Location: Greenville, SC
Posts: 3,128
Default Re: PHP and Register Globals

This is an old thread and was written before the upgrade to PHP5. You will need to remove the command from .htaccess and use the methods described here to add it to php.ini instead. You will need to put the php.ini file in each folder that you want to have register_globals turned off.
Reply With Quote
  #20  
Old 08-24-2008, 09:23 AM
ccleontez ccleontez is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 5
Default Re: PHP and Register Globals

Quote:
Originally Posted by kmaw View Post
which server are you on?
shared, baby croc
Reply With Quote
  #21  
Old 08-24-2008, 09:25 AM
ccleontez ccleontez is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 5
Default Re: PHP and Register Globals

thank you GvilleRick,

i will try that and let you know,

-cristian
Reply With Quote
  #22  
Old 08-24-2008, 09:29 AM
ccleontez ccleontez is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 5
Default Re: PHP and Register Globals

i dont have a php.ini in /home/myusername/public_html/

maybe i deleted from mistake long time ago, what shall i do now please ?
thank you,

-cristian
Reply With Quote
  #23  
Old 08-24-2008, 10:03 AM
ccleontez ccleontez is offline
Hatchling Croc
 
Join Date: Aug 2008
Posts: 5
Default Re: PHP and Register Globals

i managed to resolve this through hostgator live chat, somebody helped me and copyed a new php.ini in public_html

thanks gator,

-cristian
Reply With Quote
  #24  
Old 11-13-2008, 04:51 PM
trraacy trraacy is offline
Hatchling Croc
 
Join Date: Jun 2008
Posts: 1
Default Re: PHP and Register Globals

Quote:
Originally Posted by charlesgan View Post
yup.. you can have the register global, .htaccess overwrite, and redirection.

for php.ini.... look at the folder where you run the php from. if not have it, you need to copy the php.ini from your account public_html/.
and in the php.ini, find the line "register_globals".. set the setting to ON.
I've looked for it and I'm not finding it.

Where should I look?

TIA<
t
Reply With Quote
  #25  
Old 11-13-2008, 05:02 PM
regentronique's Avatar
regentronique regentronique is offline
King Croc
 
Join Date: Aug 2007
Location: Quebec,Canada
Posts: 969
Default Re: PHP and Register Globals

If you do not have any php.ini file and need to have the "register_globals" at On then just create a text file using windows notepad or any simple text editor and write in it

PHP Code:
 register_globals ON 
and save that file with the filename of "php.ini" at the place you run the php scripts needing this.
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 Off
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 10:51 PM.