Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

login error

Help
2008-05-23
2013-05-28
  • Swapnil Jain
    Swapnil Jain
    2008-05-23

    hi

    my installation was successful, but when i login i get the following error

    Warning: unserialize() expects parameter 1 to be string, object given in /var/www/php4dvd/includes/login.inc.php on line 35

    Fatal error: Call to a member function isEditor() on a non-object in /var/www/php4dvd/includes/movies.inc.php on line 155

    i am using ubuntu hardy with
    apache 2.2.8
    php 5.2.4

     
    • rolf
      rolf
      2008-05-23

      Hi,

      I can't reproduce this error on my Ubuntu 7.10 server. Could you send me some more bug information by changing the code in /includes/login.inc.php near line 35 to:

      // See if a user is logged in
      if(isset($_SESSION["User"])) {
          print_r($_SESSION["User"]);
          $User = unserialize($_SESSION["User"]);

      And post the output of the print_r line on this forum? Maybe I can see what is going wrong.

      cyberolf

       
      • Swapnil Jain
        Swapnil Jain
        2008-05-23

        this is what i get

        O:4:"User":15:{s:2:"id";s:1:"1";s:5:"email";s:15:"admin@admin.com";s:8:"username";s:5:"admin";s:8:"password";s:32:"21232f297a57a5a743894a0e4a801fc3";s:10:"permission";s:1:"2";s:9:"lastlogin";s:19:"2008-05-23 04:18:50";s:5:"GUEST";i:0;s:6:"EDITOR";i:1;s:5:"ADMIN";i:2;s:1:"0";s:1:"1";s:1:"1";s:15:"admin@admin.com";s:1:"2";s:5:"admin";s:1:"3";s:32:"21232f297a57a5a743894a0e4a801fc3";s:1:"4";s:1:"2";s:1:"5";s:19:"2008-05-23 03:19:16";}

        __PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => User [id] => 1 [email] => admin@admin.com [username] => admin [password] => 21232f297a57a5a743894a0e4a801fc3 [permission] => 2 [lastlogin] => 2008-05-23 04:18:50 [GUEST] => 0 [EDITOR] => 1 [ADMIN] => 2 [0] => 1 [1] => admin@admin.com [2] => admin [3] => 21232f297a57a5a743894a0e4a801fc3 [4] => 2 [5] => 2008-05-23 04:18:50 )
        Warning: unserialize() expects parameter 1 to be string, object given in /var/www/php4dvd/includes/login.inc.php on line 36

        Fatal error: Call to a member function isEditor() on a non-object in /var/www/php4dvd/includes/movies.inc.php on line 155

         
    • rolf
      rolf
      2008-05-23

      Ok, I might have found the solution:

      Remove this code in common.inc.php:

      /**
      * Common functionality neede by the site.
      *
      * Do not change this file unless you know exactly what you are doing!
      */
      session_start();

      // Local path
      $loc = dirname(__FILE__);

      and change it to:

      /**
      * Common functionality neede by the site.
      *
      * Do not change this file unless you know exactly what you are doing!
      */
      // Local path
      $loc = dirname(__FILE__);

      // Load user class, because this can be stored in session
      require_once($loc."/lib/objects/DataObject.class.php");
      require_once($loc."/lib/objects/User.class.php");
      // Start session
      session_start();

      This could solve your problem. Please let me know, because in that case, I'll post this fix for other users.

       
      • Swapnil Jain
        Swapnil Jain
        2008-05-23

        now this is what i am getting

        User Object ( [id] => 1 [email] => admin@admin.com [username] => admin [password] => 21232f297a57a5a743894a0e4a801fc3 [permission] => 2 [lastlogin] => 2008-05-23 05:36:54 [GUEST] => 0 [EDITOR] => 1 [ADMIN] => 2 [0] => 1 [1] => admin@admin.com [2] => admin [3] => 21232f297a57a5a743894a0e4a801fc3 [4] => 2 [5] => 2008-05-23 05:36:54 )
        Warning: unserialize() expects parameter 1 to be string, object given in /var/www/php4dvd/includes/login.inc.php on line 36

        Fatal error: Call to a member function isEditor() on a non-object in /var/www/php4dvd/includes/movies.inc.php on line 155

         
    • rolf
      rolf
      2008-05-23

      So the class is recognized, but it still fails to run the unserialze? This is too strange. Clear the cache, restart your browser. No more ideas.

       
    • Swapnil Jain
      Swapnil Jain
      2008-05-23

      no hope,

      tried from different pc, same error.

      swapnil

       
    • rolf
      rolf
      2008-05-23

      I have no idea how to fix this for you. Can't reproduce this error and I don't understand why the system would not be able to unserialize when the class seems to be retrieved correctly now. Maybe someone knows about this "bug"?

       
    • Kalman Makay
      Kalman Makay
      2008-09-13

      On my Debian system (Apache/2.2.3 (Debian) PHP/5.2.0-8+etch11 mod_ssl/2.2.3 OpenSSL/0.9.8c) everything are working good.

       
    • rolf
      rolf
      2008-09-13

      Good to hear. I was never able to reproduce this error, so closed for now.