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

Notices

Reply
 
Thread Tools
  #1  
Old 10-05-2006, 08:01 PM
notecat notecat is offline
Hatchling Croc
 
Join Date: Jan 2005
Posts: 6
Default PHP safe mode, register_globals, magic_quotes runtime

I'd like to install some software which requires these settings for PHP:

PHP safe mode OFF
PHP register_globals ON
PHP magic_quotes_runtime OFF

What are the default settings for HG accounts? Can I change these for my account?

Thanks!
Reply With Quote
  #2  
Old 10-05-2006, 08:01 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: PHP safe mode, register_globals, magic_quotes runtime

As long as you are on a PHP 4 machine, you will be fine. Globals are off by default in PHP 5.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #3  
Old 10-05-2006, 08:21 PM
notecat notecat is offline
Hatchling Croc
 
Join Date: Jan 2005
Posts: 6
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Thanks!

I also just learned that one can put a script such as phpinfo.php in the root directory, which yields all the php settings.

PS. Here's the script:

<?php phpinfo(); ?>

Save that as a text file as, say, phpinfo.php, and then access that page from your web browser.

Last edited by notecat; 10-05-2006 at 08:40 PM.
Reply With Quote
  #4  
Old 10-05-2006, 10:27 PM
Serra's Avatar
Serra Serra is offline
Veteran Croc
 
Join Date: Feb 2005
Location: Orange Park, FL
Posts: 5,073
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Yes, you can, but it is unwise to leave it there after you are done looking at it.
__________________
Six stages of Dedi Ownership

Fashionable broken link
image included
Reply With Quote
  #5  
Old 10-06-2006, 07:24 AM
TeeJa's Avatar
TeeJa TeeJa is offline
Royal Croc
 
Join Date: Dec 2004
Location: Kerrville & Rockport, Texas
Posts: 709
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Quote:
Originally Posted by Serra View Post
Yes, you can, but it is unwise to leave it there after you are done looking at it.

Yes, but don't name it "phpinfo.php", and put it in a passworded directory. Seems like a simple solution???
Reply With Quote
  #6  
Old 09-08-2007, 02:02 PM
transistor transistor is offline
Baby Croc
 
Join Date: Aug 2006
Posts: 54
Default How to turn off magic_quotes?

phpinfo() on Monza reports PHP version 4.4.4.
The following is the magic_quotes status:
magic_quotes_gpc On
magic_quotes_runtime Off
I've tried each of the following in .htaccess
  • php_value magic_quotes_gpc off
  • php_value magic_quotes_runtime off
  • php_value magic_quotes_gpc 0
  • php_flag magic_quotes_gpc off
but each generates an "Internal Server Error".
Any ideas what to use on HostGator? (My problem is with a content management system. The mailform sends an email with all the escapes in it and that\'s not very professional lookin\'.
Reply With Quote
  #7  
Old 09-08-2007, 02:15 PM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Put:

magic_quotes_gpc off
magic_quotes_runtime off
magic_quotes_gpc 0
magic_quotes_gpc off

in php.ini
Reply With Quote
  #8  
Old 09-08-2007, 03:48 PM
leeuniverse leeuniverse is offline
Hatchling Croc
 
Join Date: Sep 2006
Posts: 15
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Ok.... But where is "php.ini" in a Shared hosting account?

I need my registered globals off. Specifically, I want them off only on one of my domains, not the entire account. Or even better, I would like to turn them off on my entire account, and only activate them if needed in a particular domain?

How can I do this? I've looked through all the threads on this subject, and have tried the various things, and I can't figure out how to work it. Especially if I can't find php.ini? I'm on php 4.

One other thing.... If I make a custom php.ini file, and since I don't know what the settings are for the original one, won't I LOSE all the default settings if I'm only changin some peramiters such as register_globals?

Last edited by leeuniverse; 09-08-2007 at 04:04 PM.
Reply With Quote
  #9  
Old 09-08-2007, 03:50 PM
Sam Sam is offline
Emperor Croc
 
Join Date: Jan 2007
Location: /bin/false
Posts: 3,057
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Quote:
Originally Posted by leeuniverse View Post
Ok.... But where is "php.ini" in a Shared hosting account?
You need to make it in public_html
Reply With Quote
  #10  
Old 09-08-2007, 03:50 PM
gtgeorge's Avatar
gtgeorge gtgeorge is offline
Emperor Croc
 
Join Date: Mar 2005
Posts: 2,223
Default Re: How to turn off magic_quotes?

Quote:
Originally Posted by transistor View Post
phpinfo() on Monza reports PHP version 4.4.4.
The following is the magic_quotes status:
magic_quotes_gpc On
magic_quotes_runtime Off
I've tried each of the following in .htaccess
  • php_value magic_quotes_gpc off
  • php_value magic_quotes_runtime off
  • php_value magic_quotes_gpc 0
  • php_flag magic_quotes_gpc off
but each generates an "Internal Server Error".
Any ideas what to use on HostGator? (My problem is with a content management system. The mailform sends an email with all the escapes in it and that\'s not very professional lookin\'.
Actually that sounds more like a non proffesional content management system Which CMS is it?
__________________
best regards,
George
Reply With Quote
  #11  
Old 09-08-2007, 07:41 PM
regentronique's Avatar
regentronique regentronique is offline
King Croc
 
Join Date: Aug 2007
Location: Quebec,Canada
Posts: 969
Default Re: PHP safe mode, register_globals, magic_quotes runtime

A little detail i have to tell.

You need also to include Zend Optimizer directives in your php.ini file because it would be disabled by default with your php.ini file.

I had this problem when installing my first account on HostGator.

If you ask tech support they will upload you a default php.ini file that you could study and use for what you need.
Reply With Quote
  #12  
Old 09-12-2007, 02:15 PM
transistor transistor is offline
Baby Croc
 
Join Date: Aug 2006
Posts: 54
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Thanks for all the responses. I'm using CMSimple (http://cmsimple.dk). I've been reading up on magic quotes and it's quite a mess.

I received a prompt response from the author on his forum - http://www.cmsimple.dk/forum/viewtop...701&highlight= - and the problem is fixed in the app rather than goofing around on the server.
Reply With Quote
  #13  
Old 10-04-2007, 01:17 AM
lsimpson's Avatar
lsimpson lsimpson is offline
Baby Croc
 
Join Date: Sep 2007
Posts: 51
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Where can I download a copy of HG's php.ini to modify a setting and upload to a directory. I'm on Shared Server.
Reply With Quote
  #14  
Old 10-04-2007, 05:37 AM
gtgeorge's Avatar
gtgeorge gtgeorge is offline
Emperor Croc
 
Join Date: Mar 2005
Posts: 2,223
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Quote:
Originally Posted by lsimpson View Post
Where can I download a copy of HG's php.ini to modify a setting and upload to a directory. I'm on Shared Server.
Doesn't the shared CP have a Gator tool that helps with this request?
__________________
best regards,
George
Reply With Quote
  #15  
Old 10-04-2007, 05:42 AM
lsimpson's Avatar
lsimpson lsimpson is offline
Baby Croc
 
Join Date: Sep 2007
Posts: 51
Default Re: PHP safe mode, register_globals, magic_quotes runtime

I wouldn't have a clue I'm brand new here. Nothing I could see in CP but like I said.
Reply With Quote
  #16  
Old 10-04-2007, 05:47 AM
gtgeorge's Avatar
gtgeorge gtgeorge is offline
Emperor Croc
 
Join Date: Mar 2005
Posts: 2,223
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Quote:
Originally Posted by lsimpson View Post
I wouldn't have a clue I'm brand new here. Nothing I could see in CP but like I said.
Perhaps this will help:
http://forums.hostgator.com/showpost...8&postcount=45
I have used this method.
__________________
best regards,
George
Reply With Quote
  #17  
Old 10-04-2007, 09:49 PM
lsimpson's Avatar
lsimpson lsimpson is offline
Baby Croc
 
Join Date: Sep 2007
Posts: 51
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Thanks George
Reply With Quote
  #18  
Old 10-04-2007, 10:14 PM
gtgeorge's Avatar
gtgeorge gtgeorge is offline
Emperor Croc
 
Join Date: Mar 2005
Posts: 2,223
Default Re: PHP safe mode, register_globals, magic_quotes runtime

Quote:
Originally Posted by lsimpson View Post
Thanks George
Your welcome, but I really thought HG had a tool in the HG tools that allowed you to create a php.ini over ride file and symlink it. Not being a shared customer limits me to not knowing any more
__________________
best regards,
George
Reply With Quote
  #19  
Old 10-04-2007, 10:26 PM
lsimpson's Avatar
lsimpson lsimpson is offline
Baby Croc
 
Join Date: Sep 2007
Posts: 51
Default Re: PHP safe mode, register_globals, magic_quotes runtime

They have a symlink tool there but it doesn't create a php.ini. Infact the tool errors and says it can't find php.ini in root folder.
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

All times are GMT -5. The time now is 10:15 PM.