php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22741 session.bug_compat_warn and session.bug_compat_42 are ignored in the ini file
Submitted: 2003-03-17 05:26 UTC Modified: 2003-04-28 11:14 UTC
Votes:57
Avg. Score:3.9 ± 1.2
Reproduced:38 of 43 (88.4%)
Same Version:16 (42.1%)
Same OS:17 (44.7%)
From: bodgadle at yahoo dot co dot uk Assigned:
Status: No Feedback Package: Session related
PHP Version: 4.3.2-RC OS: Windows 2000 SP3
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-03-17 05:26 UTC] bodgadle at yahoo dot co dot uk
Hi there, I keep getting this error in my logile

[17-Mar-2003 11:20:36] PHP 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


I have register_globals off and have tried settting

session.bug_compat_42 = 1 (and On)
session.bug_compat_warn = 0 (and Off)

but it still comes up in my logfiles, it seems to be ignoring whatever I put in php.ini and I have restarted Apaache to make sure it rereads the ini


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-17 05:29 UTC] sniper@php.net
There was another report about this, and it was solved
by upgrading to the latest stable snapshot from http://snaps.php.net/

Also make sure the php.ini is actually used by PHP.
(check the phpinfo() output)

 [2003-03-17 15:42 UTC] bodgadle at yahoo dot co dot uk
I have now upgraded to latest stable release but afraid to say that these settings are still ignored and i'm still getting the following error message with no line number or file assocaited with it.

[17-Mar-2003 21:36:25] PHP 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
 [2003-03-17 16:02 UTC] rasmus@php.net
Then you are editing the wrong php.ini file or perhaps not actually running 4.3.  Check phpinfo() to see which version it is and where it is expecting to read your php.ini file from.
 [2003-03-17 16:19 UTC] bodgadle at yahoo dot co dot uk
Hi there,

I already checked and there's only 1 PHP.INI on my system and I am running latest version here's phnfo output showing version & ini path

PHP Version 4.3.2-RC 

System  Windows NT NUSWEB1 5.0 build 2195  
Build Date  Mar 17 2003 10:15:18  
Server API  Apache  
Virtual Directory Support  enabled  
Configuration File (php.ini) Path  C:\WINNT\php.ini
 [2003-03-17 19:51 UTC] sniper@php.net
And your php.ini is under C:\winnt\ ??
What are the settings set to in phpinfo() output?

 [2003-04-28 11:14 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2008-06-11 12:05 UTC] faizalbs at gmail dot com
I have same problem here and it give me a headeach because it involve my client website.

Someone can advise some solutions?
 [2008-07-11 19:53 UTC] webmaster at paramiliar dot com
The problem normally arises when you are using a SESSION variable and a standard variable with the same name

i.e $_SESSION['amount'] and $amount

one possible fix (untested) is to kill the session if you have finished with it or unset your variables

I beleive you can also issue an ini_set call to fix this but most of the time I have fixed this by just renaming variables
 [2010-08-04 16:08 UTC] certaplus at hotmail dot com
Regardless of the SESSION problem, the error message cannot be turned off in php.ini with :

session.bug_compat_42 = 1 
session.bug_compat_warn = 0 

neither with what is suggested in the error message :

session.bug_compat_42 = off
session.bug_compat_warn = off

tested with PHP Version 5.2.5
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 07:01:27 2024 UTC