php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16249 redeclare class when session_start()
Submitted: 2002-03-25 03:48 UTC Modified: 2002-03-25 07:41 UTC
From: ilker dot cetinkaya at ease dot de Assigned:
Status: Closed Package: Session related
PHP Version: 4.1.1 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ilker dot cetinkaya at ease dot de
New email:
PHP Version: OS:

 

 [2002-03-25 03:48 UTC] ilker dot cetinkaya at ease dot de
first of all, i want to mention that this behaviour appeared several times before i experienced it; please refer to 
http://bugs.php.net/bug.php?id=10790

which has been set to closed (although nothing was fixed on it).

what i want to report you as a definitive bug is reproduceable with a simple script:

<?php

class tester {
}
$t = new tester();
session_start();

?>

on first hit, i see following output:

Warning: open(/tmp\sess_62fb47f4ea53d0ee595c5c7ebce98559, O_RDWR) failed: No such file or directory (2) in C:\test_bug.php on line 8

this is correct because default session provider in php.ini is file and my tmp directory doesn't have sufficient permissions.

hittig the script again produces this:

Fatal error: Cannot redeclare class tester in C:\test_bug.php on line 3

this is totally wrong. i do not redeclare anything on this script. it is the very first coding line which this fatal error references.

if you hit the page more often you'll see the fatal error every 2nd hit. this behaviour has been also complained in bug id 10790.

but i guess sniper didn't see it serious enough to make some heavy reproducement tests.

the reason why this is a session related bug is because of session_start() function call.

if you leave out session_start(), everything works fine.

i want to empasize once more that i could reproduce the bug on several boxes running php4.1.1 on w2k/iis5.

here's my config:
windows 2000 (pro & server), sp2
iis5 running php_isapi.dll
extensions oci, xslt, gd, dom
php 4.1.1 isapi enabled

hth
ilker

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-25 04:40 UTC] ilker dot cetinkaya at ease dot de
hint:

on php4.1.2 with same config as above the problem does not exist.

good work.
thanks
ilker
 [2002-03-25 07:41 UTC] derick@php.net
If it works, we close it.

Derick
 [2003-06-10 11:37 UTC] phpbugs at sauen dot com
This problem persists in 4.1.2 as well, although not so severe (perhaps). Debian Woody uptodate packages of Apache 1.3.2x and PHP 4.1.2, Kernel 2.4.18 (LIDS patched). Up and running fine for 60 days, all the sudden giving such "Cannot redeclare class.." errors on frequent reloads, wait a minute and it works again for a while.. I have both Apache and Apache-SSL installed, seems to be the same no matter which I try. Stopping and starting Apache and Apache-SSL made no difference.. Rebooting the machine did, we'll see how long it lasts now, I have no idea if it is mod_php, apache or kernel related (or LIDS)..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 21:01:34 2024 UTC