Guest Posted January 11, 2006 Posted January 11, 2006 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?
Guest Posted January 11, 2006 Posted January 11, 2006 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?
jefs.42 Posted January 12, 2006 Posted January 12, 2006 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
AlanR Posted January 12, 2006 Posted January 12, 2006 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)
Guest Posted January 12, 2006 Posted January 12, 2006 See: http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=766297 thanks for the help Alan. i checked my sessions.php files and they're both already set to: $nothing = 0; ... and i'm still getting that random error message.
mluusua Posted January 16, 2006 Posted January 16, 2006 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.
Guest Posted January 16, 2006 Posted January 16, 2006 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.
Guest Posted January 25, 2006 Posted January 25, 2006 hello all, i still haven't found a fix for this problem. any help would be very appreciated. thanks!
TXprogrammer Posted February 3, 2006 Posted February 3, 2006 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!
♥Vger Posted February 3, 2006 Posted February 3, 2006 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
mr_absinthe Posted February 6, 2006 Posted February 6, 2006 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
Guest Posted February 8, 2006 Posted February 8, 2006 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/
♥Vger Posted February 8, 2006 Posted February 8, 2006 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
Guest Posted February 8, 2006 Posted February 8, 2006 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. :/
spax Posted February 8, 2006 Posted February 8, 2006 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.
benspun Posted February 10, 2006 Posted February 10, 2006 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,
singlemalt Posted February 11, 2006 Posted February 11, 2006 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 :(
AlanR Posted February 11, 2006 Posted February 11, 2006 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)
spax Posted February 11, 2006 Posted February 11, 2006 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:
singlemalt Posted February 13, 2006 Posted February 13, 2006 thanks for you help! I finally got register_globals turned on using an .htaccess file. it's now working
mr_absinthe Posted February 21, 2006 Posted February 21, 2006 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
Snowman Posted February 21, 2006 Posted February 21, 2006 Have you restarted apache after adding the line to the .htaccess?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.