Guest Posted February 19, 2003 Posted February 19, 2003 Half of the main page comes up. The other half is as follows: Error! Unable to determine the page link! Warning: Unknown(): 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 Unknown on line 0 Any help would be appreciated. Thank you.
Overdog Posted February 19, 2003 Posted February 19, 2003 Make sure globals set to ON set session.bug_compat_warn to OFF set session.bug_compat_42 to OFF try that ...
Guest Posted February 19, 2003 Posted February 19, 2003 Hi, Could you please tell me where these files are? set session.bug_compat_warn to OFF set session.bug_compat_42 to OFF Thanks! I know register_globals is listed in the php.ini file on my server but cannot find those other 2 files.
toolcrazy Posted February 19, 2003 Posted February 19, 2003 I believe you just add them to your PHP.ini file. Steve -------------------------
wizardsandwars Posted February 19, 2003 Posted February 19, 2003 Razonmy, Just for experimentaions sake, have you been able to successfully checkout in test mode? The reason that I ask is because we have seen other problems occur when using OSc with php 4.3 that had to do with global variables that were similar to this but not exactly the same. Thanks for your help. ------------------------------------------------------------------------------------------------------------------------- NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit. If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
Guest Posted February 20, 2003 Posted February 20, 2003 Haven't tried Test mode. I will be more than happy to try this if you tell me how.
shady Posted February 20, 2003 Posted February 20, 2003 Hi guys I wonder if you can help me? My site is giving the following error, when creating an account: Query was empty - Query was empty Query was empty [TEP STOP] Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0 Global sessions is enabled but set session.bug_compat_warn & set session.bug_compat_42 are both ON. I'm not sure if my ISP will change this for me, but could this be causing the problem?
Trailz Posted February 20, 2003 Posted February 20, 2003 What happens if you click refresh in the browser after you get that message?
toolcrazy Posted February 20, 2003 Posted February 20, 2003 Couldn't they just add these to their .htaccess file in root? set session.bug_compat_warn to OFF set session.bug_compat_42 to OFF Steve -------------------------
shady Posted February 20, 2003 Posted February 20, 2003 Hi Greg If I hit Refresh it then continues to display the account details correctly. After putting in some "echo"s I have determined that the errors are occuring in $cart->restore_contents function although I did comment this out to see what happened and then received a number of different errors.
dreamscape Posted February 20, 2003 Posted February 20, 2003 here, this will solve many problems you'll get with PHP v4.3.0 including the "query was empty" error... some superglobals that OSC uses for PHP 3 compatibility are no longer used in PHP v4.3.xx see this: http://www.oscommerce.com/forums/viewtopic.php...4417&highlight= The only thing necessary for evil to flourish is for good men to do nothing - Edmund Burke
shady Posted February 20, 2003 Posted February 20, 2003 Hi Joshua Thanks, but I've already made the global changes from $HTTP_.... to $_.... variables and it doesn't seem to fixed this problem. I've grep'd through the entire site to ensure I've not missed any. Any experts want to earn a quick donation, I'd be happy to pay for somebody to give me the answer! Thanks Laurence
elke Posted February 21, 2003 Posted February 21, 2003 Well, since I find the current (unsecure?) version pretty annoying too, I took the time to fix all scripts, so that osc 2.2 cvs 2003-02-12 runs with apache 2.0.43 + php 4.3.0 + mysql with: apache.shop.conf: PHPINIDir "conf" php_admin_value open_basedir "/opt/www/sites/shop/htdocs:/scratch/tmp/osc" php_admin_value safe_mode_include_dir /opt/www/sites/shop/htdocs php.ini: engine = On safe_mode = On safe_mode_allowed_env_vars = PHP_ error_reporting = E_ALL display_errors = Off log_errors = On error_log = /var/log/httpd/php_errors.log variables_order = "GPCS" register_globals = Off session.use_cookies = 1 session.bug_compat_42 = 0 Rest remains as is (default). What I did, was actually: :1,$s/HTTP_GET_VARS/_GET/g :1,$s/HTTP_POST_VARS/_POST/g :1,$s/HTTP_COOKIE_VARS/_COOKIE/g :1,$s/DIR_WS_INCLUDES/DIR_FS_INCLUDES/g :1,$s/DIR_WS_FUNCTIONS/DIR_FS_FUNCTIONS/g :1,$s/DIR_WS_CLASSES/DIR_FS_CLASSES/g :1,$s/DIR_WS_MODULES/DIR_FS_MODULES/g :1,$s/$PHP_SELF/$_SERVER['PHP_SELF']/g :1,$s/get_cfg_var/ini_get/g # and adapt values in configure.php scripts - can?t see any reason, why it should not referred # via filesystem - this is actually, how the buggy php stuff tracks includes and might # sometimes even fail, if one would use relative pathes (xy not in safe_include_path error) define('DIR_FS_INCLUDES', DIR_FS_CATALOG . 'includes/'); define('DIR_FS_FUNCTIONS', DIR_FS_INCLUDES . 'functions/'); define('DIR_FS_CLASSES', DIR_FS_INCLUDES . 'classes/'); define('DIR_FS_MODULES', DIR_FS_INCLUDES . 'modules/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); # substitute getenv with $_SERVER super globals /getenv -> $_SERVER['...'] # delete the following tep_session_* stuff and use $_SESSION[".."] stuff instead # which is the php recommended way tep_session_register(...) -> $_SESSION['...'] = $var_value; tep_session_is_registered(...) -> isset($_SESSION['...']) tep_session_unregister(...) -> $_SESSION['...'] = NULL; unset($_SESSION['...']) tep_session_close() -> delete (we do not use ancient PHP 3) # replace the following globals with their SESSION equivalent: # in catalog: customer_id cartID shipping payment comments billto sendto customer_first_name customer_default_address_id customer_country_id customer_zone_id cart language languages_id currency navigation new_products_id_in_cart # in admin: current_path language languages_id selected_box messageToStack new_products_id_in_cart Perhaps, this helps. Regards, elke.
shady Posted February 21, 2003 Posted February 21, 2003 Thanks for that. Are the changes to php.ini necessary to make this fix work or just for added security? Thanks again Laurence
elke Posted February 21, 2003 Posted February 21, 2003 Nope. AFAIK, these are the "most important parameters" set to their "most restricting" values, which prevent people from running osc with php4 in a secure? environment. Regards, jens.
shady Posted February 22, 2003 Posted February 22, 2003 FIX SCRIPTS FOR PHP 4.3 If any of you folks are still having problems, I have managed to fix my old snapshots of OSCommerce and scripted the changes, so you can run with a simple single command. The fix does the following: Globally edit to replace old super globals. Replace some scripts with MS1 scripts, which have been editted for backward compatability. This fixes the errors which are received following create_account and edit_account. A tar'd copy of the scripts can be found at http://www.windowsshopping.com/software/fix.html Please be aware that, due to the actual snapshot which you are running being unknown, the fix is not guaranteed SO BACKUP FIRST (p.l.e.a.s.e)! Lastly, as I was profusely crying whilst working on this, due to 3 customer sites being down, I have probably not adhered to the OSCommerce standards of comments. Apologies for this! Please let me know how you get on Best regards Laurence Jones
shady Posted February 27, 2003 Posted February 27, 2003 Anyone got any success stories to post, regarding my script?
shahed Posted February 27, 2003 Posted February 27, 2003 shady Is your script going to replace some Files? I have modified my oscommerce a lot and I do not want to replace any files. I will try to run your script tonight but please let me know
shady Posted February 27, 2003 Posted February 27, 2003 Hi Shahed Yes it does replace the following scripts with edited MS1 versions: account_edit.php account_edit_process.php create_account.php create_account_process.php create_account_success.php database.php general.php password_funcs.php Other than that, it simply replaces the super globals. Regards Laurence
shahed Posted February 27, 2003 Posted February 27, 2003 I'm running a August 2002 snapshot, do you think I can run your script?
shady Posted February 27, 2003 Posted February 27, 2003 I'd say that would be around the same time as I was running but do a tar backup first or copy the entire set of scripts to a development directory first. Then you can feel safe! If you are not sure what you are doing, I'll run it for you, if you like.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.