[advanced search]
NamePros Domain Auction
Live Event This Thursday at 6PM EDT - Prebidding open now
10 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 03-21-2008, 05:56 PM   · #1
mholt
DNOA Member
 
mholt's Avatar
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,869
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Question .htaccess and register_globals

Hello...

For OsCommerce to work, apparently one needs to enable register_globals. (??? What were they thinking ???) Anyway, been trying various methods in .htaccess to do this:

Code:
<Directory "/home/aether/public_html/shoppingcart"> AllowOverride All php_admin_flag register_globals on php_admin_flag register_long_arrays on </Directory>


These cause Misconfig 500 errors.

Have also tried:

Code:
php_value register_globals 1


Also error 500.

Any other ideas? I'm running CentOS. .htaccess definitely works, because I've used mod_rewrite... among other things.

Thanks.
-mholt


Please register or log-in into NamePros to hide ads

Last edited by mholt : 03-23-2008 at 05:28 AM.
mholt is offline   Reply With Quote
Old 03-21-2008, 06:01 PM   · #2
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (235)
Join Date: Dec 2005
Posts: 19,484
NP$: 16092.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
if you have ssh access, edit php.ini
find this line:
register_globals = Off
change to:
register_globals = On

php.ini is usually located on /etc
weblord is offline  
  Reply With Quote
Old 03-21-2008, 06:10 PM   · #3
mholt
DNOA Member
 
mholt's Avatar
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,869
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Sorry, should have clarified: I don't want every CPanel account to have register_globals on, just one. Changing php.ini would modify the setting server-wide, which is an uber-no-no. Thanks for the response, but that's not what I want to do. Is there anything else in .htaccess that I should set?
mholt is offline   Reply With Quote
Old 03-21-2008, 08:03 PM   · #4
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (235)
Join Date: Dec 2005
Posts: 19,484
NP$: 16092.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
try adding this on your .htaccess on a folder
Code:
php_admin_value register_globals On
weblord is offline  
  Reply With Quote
Old 03-21-2008, 09:27 PM   · #5
mholt
DNOA Member
 
mholt's Avatar
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,869
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Hmm nope, gives a Server misconfig error again.

Also tried changing "On" to "1". Didn't work.
mholt is offline   Reply With Quote
Old 03-21-2008, 09:32 PM   · #6
Tree
NamePros Regular
 
Tree's Avatar
 
Name: Trevor
Location: Atlanta, GA, USA
Trader Rating: (3)
Join Date: Feb 2006
Posts: 334
NP$: 0.00 (Donate)
Tree will become famous soon enoughTree will become famous soon enough
In the header or functions file of oscommerce place this:

PHP Code:
ini_set('register_globals', 'on');


register_globals can also be emulated using this code:

PHP Code:
// Emulate register_globals
if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV,
$_FILES, $_COOKIE, $_POST, $_GET);
if (isset(
$_SESSION)) {
array_unshift($superglobals, $_SESSION);
}
foreach (
$superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
}
__________________
NCIDev.com
Tree is offline   Reply With Quote
Old 03-21-2008, 10:40 PM   · #7
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (235)
Join Date: Dec 2005
Posts: 19,484
NP$: 16092.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
try putting
Code:
register_globals = On

or
Code:
php_flag register_globals On
weblord is offline  
  Reply With Quote
Old 03-22-2008, 03:54 AM   · #8
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (45)
Join Date: Nov 2003
Posts: 4,183
NP$: 2054.15 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
Have you tried creating a php.ini file and putting the directive into that. If I remember correctly if you have safe mode enabled php directives need t be in the php.ini file.

If this is the case you do not edit the main php.ini file you create a new 1 and enter the options into tha and place it in the root folder for that hosting package.
Peter is online now   Reply With Quote
Old 03-22-2008, 06:45 AM   · #9
mholt
DNOA Member
 
mholt's Avatar
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,869
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Using ini_set is not going to work, because by the time the script is executed, register_globals was already applied to the script. See: http://us2.php.net/manual/en/function.ini-set.php#19874

Tree: That second method would be great, and thanks for that code, except the shopping cart will display an error if the whole setting is 0 / off. I suppose we could just disable the display of that error and put that script on each page, though. Still an option.

Weblord: I can't edit the php.ini file, because I need this to apply only to the one cpanel account.

Originally Posted by peter@flexiwebhost
Have you tried creating a php.ini file and putting the directive into that. If I remember correctly if you have safe mode enabled php directives need t be in the php.ini file.

If this is the case you do not edit the main php.ini file you create a new 1 and enter the options into tha and place it in the root folder for that hosting package.


Interesting indeed! I will investigate using safe mode in the main php.ini and try this method. Thanks.
mholt is offline   Reply With Quote
Old 03-22-2008, 06:15 PM   · #10
SecondVersion
while ($awake){ code(); }
 
SecondVersion's Avatar
 
Name: Eric
Location: Kentucky
Trader Rating: (142)
Join Date: Mar 2005
Posts: 4,241
NP$: 386.00 (Donate)
SecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond reputeSecondVersion has a reputation beyond repute
Member of the Month
MOTM September 2005 Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Cancer Alzheimer's Protect Our Planet
Originally Posted by peter@flexiwebhost
Have you tried creating a php.ini file and putting the directive into that. If I remember correctly if you have safe mode enabled php directives need t be in the php.ini file.

If this is the case you do not edit the main php.ini file you create a new 1 and enter the options into tha and place it in the root folder for that hosting package.


I wouldn't recommend safe mode. I believe using suExec offers this option, which would be better than enabling safe mode.
__________________

SecondVersion.com - The Personal Blog of SecondVersion
Domain Name Portfolio - Get your free copy. - Version 1.0.2 now available!!
MetaCreator.com - Free Meta Tag Creator
CodingPlanet.com - Coming soon...
SecondVersion is offline   Reply With Quote
Old 03-23-2008, 03:34 AM   · #11
Peter
NamePros Staff
 
Peter's Avatar
 
Name: Peter
Location: Scotland
Trader Rating: (45)
Join Date: Nov 2003
Posts: 4,183
NP$: 2054.15 (Donate)
Peter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud ofPeter has much to be proud of
Child Abuse Save The Children Save The Children
yes by all means. My post wasn't to recommend the option but rather to point out it is housed in a php.ini file if you are using safe mode. The op should look to see if he hs that enabled.
Peter is online now   Reply With Quote
Old 04-02-2008, 06:12 PM   · #12
mholt
DNOA Member
 
mholt's Avatar
 
Name: Matthew Holt
Location: 127.0.0.1
Trader Rating: (75)
Join Date: May 2004
Posts: 4,869
NP$: 17.21 (Donate)
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
After much deliberation, I've decided to advise the guy using OsCommerce to use a different shopping cart package. OsCommerce is disgusting.
mholt is offline   Reply With Quote
Old 04-02-2008, 06:14 PM   · #13
weblord
www.1weblord.com
 
weblord's Avatar
 
Name: William R. Nabaza - williamrnabaza.com
Location: Philippines - www.Nabaza.com
Trader Rating: (235)
Join Date: Dec 2005
Posts: 19,484
NP$: 16092.28 (Donate)
weblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatnessweblord Has achieved greatness
Autism Protect Our Planet
that's better, i hope these issues will get resolved for you the soonest.
weblord is offline  
  Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Click to Watch Instant Video Traffic Down Under Traffic Down Under
Advertise your business at NamePros
All times are GMT -7. The time now is 11:38 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0