Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:33:32+00:00 2026-06-09T00:33:32+00:00

When update my PHP version to 5.4 (xampp 1.8.0) I see a Fatal error

  • 0

When update my PHP version to 5.4 (xampp 1.8.0) I see a Fatal error:

Fatal error: Cannot redeclare class Session in C:\xampp\htdocs\vs\classes\session.class.php on line 5

Is this problem related to update PHP version’s?

session.class.php:

<?php
defined('_VALID') or die('Restricted Access!');

class Session
{   // <-- This Is Line 5 
    private static $_sess_db;

    public static function open() {
        global $config;    

        if (self::$_sess_db = mysql_connect($config['db_host'], $config['db_user'], $config['db_pass'])) {
            return mysql_select_db($config['db_name'], self::$_sess_db);
        }

        return false;
    }

    public static function close() {
        return mysql_close(self::$_sess_db);
    }

    public static function read($session_id) {
        $sql = sprintf("SELECT `session_data` FROM `sessions` WHERE `session_id` = '%s'", mysql_real_escape_string($session_id));
        if ($result = mysql_query($sql, self::$_sess_db)) {
            if (mysql_num_rows($result)) {
                $record = mysql_fetch_assoc($result);
                return $record['session_data'];
            }
        }

        return '';
    }

    public static function write($session_id, $session_data)
    {
        $sql = sprintf("REPLACE INTO `sessions` VALUES('%s', '%s', '%s')", mysql_real_escape_string($session_id),
                        mysql_real_escape_string(time()), mysql_real_escape_string($session_data) );

        return mysql_query($sql, self::$_sess_db);
    }

    public static function destroy( $session_id )
    {
        $sql = sprintf("DELETE FROM `sessions` WHERE `session` = '%s'", $session_id);
        return mysql_query($sql, self::$_sess_db);
    }

    public static function gc($max) {
        $sql = sprintf("DELETE FROM `sessions` WHERE `session_expires` < '%s'", mysql_real_escape_string(time() - $max));
        return mysql_query($sql, self::$_sess_db);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:33:33+00:00Added an answer on June 9, 2026 at 12:33 am

    It seems that you are including session.class.php more than once… or you declare the class Session in another file that is included.

    As @cegfault says: include_once and require_once can be used to prevent this.

    But it is better to make sure that you only include the file just once (less memory usage). include_once and require_once are just fail saves.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suddenly, I'm getting this notice from php after a recent php version update. It
Update: This question is a duplicate of Are there any programming languages targeting PHP,
I get this error when using some library called: Mcrypt extension: Fatal error: Uncaught
(Update) Problem was due to my php version not being the minimum version specified
Before the PHP Version update I used to be able to include files as
I'm trying to update a PHP module using yum, but am getting an error.
how to easily update php web application to multiple server ? i read about
I have the following link on index page <td align=center><a href=../athena/admin/update.php?id=' . $data [keyword]
I want to update my PHP GUI view when my data source is updated(data
I am trying to use a PHP form (new.php) to update 2 MySQL tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.