1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Warning: Unknown: Your script possibly relies on a session side-effect which existed

Discussion in 'Optigold ISP' started by coldgansta, Aug 6, 2007.

  1. #1
    I have this warning at the botom of my home-page


    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

    Plz advise to remove this.
    Thanks
     
    coldgansta, Aug 6, 2007 IP
  2. viponline

    viponline Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    do NOT turn off session.bug_compat_warn
    it states clear that in all versions below PHP 4.2.3 extensions does not consider global variables as a source of data
    hope that helps
     
    viponline, Aug 9, 2007 IP
  3. coldgansta

    coldgansta Guest

    Messages:
    1,614
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Sorry but no it dont help,as ime somewhat a noob with php.
    I need a answer for this problem that a nooby like me can fix.
    Thanks
     
    coldgansta, Aug 9, 2007 IP
  4. coldgansta

    coldgansta Guest

    Messages:
    1,614
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #4
    some1 must have a fix for this
     
    coldgansta, Aug 9, 2007 IP
  5. EGS

    EGS Notable Member

    Messages:
    6,078
    Likes Received:
    438
    Best Answers:
    0
    Trophy Points:
    290
    #5
    Upgrade to a newer version of PHP.
     
    EGS, Aug 10, 2007 IP
  6. Dan-Da-Man

    Dan-Da-Man Peon

    Messages:
    216
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    upgrade and make sure ur server/hosting is set to php enabled
     
    Dan-Da-Man, Aug 13, 2007 IP
  7. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    In your php.ini files set session.bug_compat_warn = Off
    It sounds like it's a register_globals issue, which the 'jist of it means if the url is like index.php?var=val, then it makes the variable $var and gives it the value 'val' (when register globals is on), otherwise you use $_GET['var'] to access the data, which is more proper and more secure, it just sounds to me like it's something similar but for sessions, I've never heard of it, but then it's really old and antiquated PHP and it was mainly done by lazy or inexperienced coders.
     
    projectshifter, Aug 13, 2007 IP
  8. aquasonic

    aquasonic Well-Known Member

    Messages:
    90
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    115
    #8
    Yay! I'm obviously lazy - I'm getting this error in my error log too!

    The trouble is - it's not obvious which file is causing the error?

    It seems to be a harmless error as I've had no problems with any of my website, but yet this error keeps cropping up.

    Oh well... as long as it's not causing a noticeable error - I'm happy!
     
    aquasonic, Sep 3, 2007 IP
  9. coldgansta

    coldgansta Guest

    Messages:
    1,614
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I solved this error.And thank all for your replys and help.

    The fix.
    Make a new file called ini.php
    add this code

    session.bug_compat_42 = 1
    session.bug_compat_warn = 0

    it works for my site.I have atached the file to this thread if any1 need it
     

    Attached Files:

    • ini.php
      File size:
      54 bytes
      Views:
      5,818
    coldgansta, Sep 3, 2007 IP
  10. nisshongo

    nisshongo Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Thanks! I was also looking for a code to deactivate this unnecessary warning. Your code worked fine.
     
    nisshongo, Apr 4, 2009 IP
  11. vaneXsa

    vaneXsa Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Hi Goldgansta,
    can you plz tell me after creating the ini.php file, where shall i place ? Does it need to be include in the respective file ? or the folder...
    Thanks for your quick help
     
    vaneXsa, Jul 23, 2009 IP
  12. coldgansta

    coldgansta Guest

    Messages:
    1,614
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Place the file inside your public_html folder.
    It should work if not i can have a look for you!
     
    coldgansta, Jul 23, 2009 IP
  13. skinsey1

    skinsey1 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    I found this by trying to resolve the issue of the error message of:

    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


    After reviewing these post and attempting to resolve the issue stated above it did not work for me. Here is how I finally resolved the issue.

    added these two lines of code to my .htaccess file in the root directory

    php_flag session.bug_compat_42 1
    php_flag session.bug_compat_warn 0
     
    skinsey1, Oct 28, 2009 IP
  14. coldgansta

    coldgansta Guest

    Messages:
    1,614
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #14
    Yes that option also works if you hosting company does not allow custom ini.php

    Thanks for adding that fix it will come in handy for those situations..:)
     
    coldgansta, Oct 31, 2009 IP
  15. omnibet

    omnibet Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #15
    In my opinion all hosting companies should let customers customize their php.ini , I do not understand why they are not allowing their clients to use and modify php.ini...
     
    omnibet, Jan 7, 2010 IP
  16. oxidati0n

    oxidati0n Peon

    Messages:
    744
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #16
    I have had this problem in the past, it means you've produced content or you have spaces before <?php or session_start(). Since session_start() works with cookies, and cookies works with headers, they must be before any sort of content is produced.
     
    oxidati0n, Jan 15, 2010 IP
  17. pro4rock

    pro4rock Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    I had the same error:
    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.

    on code like this:

    <?php
    $currentCatId = $_SESSION['currentCatId'];

    if (isset($_GET['catId'])) {
    $currentCatId = $_GET['catId'];
    }

    .......

    for ($c=0;$c<count($categories);$c++) {

    if (isset($currentCatId)) {

    if ($categories[$c]['category_id'] == $currentCatId) {
    echo 'string';
    }
    }
    }
    ?>



    and solved the error by changing my code to this:

    <?php

    if (isset($_GET['catId'])) {
    $_SESSION['currentCatId'] = $_GET['catId'];
    }

    .......

    for ($c=0;$c<count($categories);$c++) {

    if (isset($_SESSION['currentCatId'])) {

    if ($categories[$c]['category_id'] == $_SESSION['currentCatId']) {
    echo 'string';
    }
    }
    }
    ?>


    "isset" doesnt seem to like non-global variables.
     
    pro4rock, Apr 1, 2010 IP
  18. Paamayim

    Paamayim Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    I had this Warning when I used as a session index the same name for a global PHP variable, even if I used them as separate variables.

    global $foo;
    $_SESSION['foo']

    This gave me the warning. I renamed one variable and warning got away.

    global $foo;
    $_SESSION['_foo']
     
    Paamayim, Aug 30, 2010 IP
  19. JoeyWong

    JoeyWong Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Hi all, i also faced this problem. I am using XAMPP so where should I put these??

    session.bug_compat_42 = 1
    session.bug_compat_warn = 0
     
    JoeyWong, Dec 1, 2010 IP
  20. JoeyWong

    JoeyWong Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Hi, this is my php.ini. how I can it so that it won't come out the warning?? thanks~

    ; session.bug_compat_42
    ; Default Value: On
    ; Development Value: On
    ; Production Value: Off

    ; session.bug_compat_warn
    ; Default Value: on
    ; Development Value: on
    ; Production Value: Off
     
    JoeyWong, Dec 1, 2010 IP