Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

register_globals


Guest

Recommended Posts

Posted

i installed the patch that allows you to have register_globals turned off and everything seemed to work fine. but i'll randomly get error messages saying:

 

Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/cust1/username/html/catalog/includes/functions/sessions.php on line 151

 

i see nothing to disable in that general area. anyone?

Posted
It's in php.ini

 

Vger

 

i do not have access to the php.ini file. my server is on lock down. :/

 

is there a work around?

Posted

in the main catalog directory is a .htaccess file you should be able to just add this to the end of that file:

 

php_flag register_gobals on

Posted
i installed the patch that allows you to have register_globals turned off and everything seemed to work fine. but i'll randomly get error messages saying:

 

Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/cust1/username/html/catalog/includes/functions/sessions.php on line 151

 

i see nothing to disable in that general area. anyone?

See: http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=766297

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Posted

I ran into this and have the stupidly simple solution, thanks to my host.

 

Open Notepad or your favorite text editor, make a simple text file that contains only this

 

register_globals = On

 

no need for any tags, etc.

 

save it as php.ini

 

upload it to your root store directory, and to the admin folder.

 

Ta Da

 

Vgers patches are very cool, but ONLY if it is a clean install, as indicated in the readme.

Posted
I ran into this and have the stupidly simple solution, thanks to my host.

 

Open Notepad or your favorite text editor, make a simple text file that contains only this

 

register_globals = On

 

no need for any tags, etc.

 

save it as php.ini

 

upload it to your root store directory, and to the admin folder.

 

Ta Da

 

Vgers patches are very cool, but ONLY if it is a clean install, as indicated in the readme.

 

well, i'm unable to do that. the documentation of the "register_globals patch" i installed says that after installed register_globals has to be off for it to work.

 

so, i'm unsure of what to do.

  • 2 weeks later...
Posted

hello all, i still haven't found a fix for this problem. any help would be very appreciated. thanks!

Posted

I have run into this same problem. Here is what I have done.

 

Set in php.ini and uploaded to htdocs and admin folder:

register_globals = On

session.bug_compat_42 = 1

session.bug_compat_warn = 1

 

Also changed sessions.php to:

$nothing = 0;

 

I am still getting the message.

 

Any other suggestions?

Everybody be quiet, the voices in my head are trying to tell me something!

Posted
well, i'm unable to do that. the documentation of the "register_globals patch" i installed says that after installed register_globals has to be off for it to work.

 

Well ...yes - that's the general idea. You install the Register Globals patch if Register Globals is set to 'off' in php.ini - otherwise there's not strictly a need to install it.

 

Vger

Posted

Hello,

 

I was wondering if you might be able to help me a little bit with register globals. I'm trying to use this currency update contribution. It works fine when I call it from my browser, currencies are updated and email sent. However when I set up a cron job for it, I receive this famous message: FATAL ERROR: register_globals is disabled in php.ini, please enable it!

 

I've been trying to apply some recommandations from here.

 

Unfortunately it didn't work :(

 

I don't have acess to php.ini, register globals are off by default and I have php_flag register_globals on in my .htaccess.

 

Any ideas? Thank you.

 

Alex

Absinthe Original Liquor Store

Posted

ok, maybe i should explain myself again... my server has register_globals turned OFF. i do not have access to the PHP.INI file, so i can not turn it on.

 

i installed this contribution:

http://www.oscommerce.com/community/contributions,2097

 

...i followed all the directions in the installation... i checked my sessions.php file and $nothing = 0; is true...

 

i think i've tried everything that's been posted here, and an still getting this error:

 

Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/cust1/username/html/catalog/includes/functions/sessions.php on line 151

 

i've surfed through the user end of the site trying to find out when the error occurs. it seems like it doesn't show up until the user is logged in and going through the checkout process. but, in the admin area it shows up after a few minutes of adding products, or attributes.

 

either way, after the error appears it doesn't go away until you close the window and reload the site in a new window.

 

so, i'm still unsure of what to try next. your help is very appreciated!

 

EDIT: if you're curious to see the site i'm working on, here's a link to the temp site: http://209.35.116.232/catalog/

Posted

In php.ini, you'd find this (if you had access):

 

session.bug_compat_42 = 1

session.bug_compat_warn = 1

 

You can try this in a .htaccess file in the root of your web - but not sure if it will work:

 

php_flag session.bug_compat_42 = off

php_flag session.bug_compat_warn = off

 

If not then try adding the code below to a php.ini file in your catalog and admin folders:

 

session.bug_compat_42 = 0

session.bug_compat_warn = 0

 

Vger

Posted
You can try this in a .htaccess file in the root of your web - but not sure if it will work:

 

php_flag session.bug_compat_42 = off

php_flag session.bug_compat_warn = off

 

If not then try adding the code below to a php.ini file in your catalog and admin folders:

 

session.bug_compat_42 = 0

session.bug_compat_warn = 0

 

Vger

 

i tried the .htaccess first and it threw up an 500 internal server error... so, then i tried the php.ini files in the catalog & admin folders and i still got the error at checkout. :/

Posted

Hi all,

 

I am trying to install on my local machine and am having the register_globals problem also.

 

This maybe a dumb question, but where should the php.ini file be located for osCommerce to work? I ask that because I have 3 php.ini files within WAMP5 and changing any of them, where they are, does jack. Incidentally, in the php.ini file, it states that turning 'ON' register_globals is a bit of a security issue so is it ok to do it?

 

Cheers,

 

Peter.

Posted
Hi all,

 

I am trying to install on my local machine and am having the register_globals problem also.

 

This maybe a dumb question, but where should the php.ini file be located for osCommerce to work? I ask that because I have 3 php.ini files within WAMP5 and changing any of them, where they are, does jack. Incidentally, in the php.ini file, it states that turning 'ON' register_globals is a bit of a security issue so is it ok to do it?

 

Cheers,

 

Peter.

 

I don't know much about the problems of the others, but I use WAMP5 myself, and the php.ini that you have to modify is in [your_wamp5_installation]\Apache\php.ini, on line 373.

 

You have to shut down WAMP5 and restart it again for it for the changes to take effect.

 

Good luck,

Posted

I am also having problems with:

 

"Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/httpd/vhosts/kiteoutlet.com/httpdocs/catalog/includes/functions/sessions.php on line 151"

 

I've tried everything mentioned in this thread and still no luck :(

Posted
I am also having problems with:

 

"Warning: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in /home/httpd/vhosts/kiteoutlet.com/httpdocs/catalog/includes/functions/sessions.php on line 151"

 

I've tried everything mentioned in this thread and still no luck :(

In the the register globals patch package you'll find a file named link_session_variable.txt

 

Richard Bentley in his update to v1.3 of his Register Globals Patch Files makes a change in both the admin and catalog sessions.php file to the function link_session_variable. This is what he says about the change:

 

"Function : link_session_variable() The $nothing variable ought to be initialised (this can cause warnings to be issued on some PHP installations)"

 

If you need to make the change this

is what he refers to:

 

// Unmap global from session variable (note that the global variable keeps the value of

// the session variable. This should be unnecessary but it reflects the same behaviour

// as having register_globals enabled, so in case the OSC code assumes this behaviour,

// it is reproduced here

$nothing;

 

IS CHANGED TO:

 

// Unmap global from session variable (note that the global variable keeps the value of

// the session variable. This should be unnecessary but it reflects the same behaviour

// as having register_globals enabled, so in case the OSC code assumes this behaviour,

// it is reproduced here

$nothing = 0;

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Posted
I don't know much about the problems of the others, but I use WAMP5 myself, and the php.ini that you have to modify is in [your_wamp5_installation]\Apache\php.ini, on line 373.

 

You have to shut down WAMP5 and restart it again for it for the changes to take effect.

 

Good luck,

 

 

Thanks benspun,

 

I figured it out in the end, that I had to restart the server. However, being a bit concerned with the security issue, as stated in the php.ini file, I have left the register_globals disabled and incorporated Vger's patch. Everything seems to be working, as far as I have got (which isn't far) at least. I have a couple of warnings to deal with now, one is easy but the other needs some research. I will probably need to make a new thread to deal with it.

 

One thing I don't understand, if enabling register_globals is a security risk and being as the patch (apparently) works, why is there a need for it in the first place? Or does the patch effectively enable register_globals?

 

Very strange! :huh:

Posted

Hello,

 

I'm having some difficulties with register_globals and currencies update, perhaps you might be able to help me.

 

When I call the script from my browser, currencies are updated however when I set a cron job, I'm receiving message that register_globals is disabled in php.ini. This is what I've tried so far:

 

I have "php_flag register_globals on" in my .htaccess.

 

I have created php.ini with register_globals = On in and uploaded to root as well as to admin directory.

 

With all the above done I run cron job and receive that FATAL ERROR message again, so I'm completely stuck at the moment... :'(

 

Any ideas please? Thank you.

Absinthe Original Liquor Store

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...