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

Close

error after running auto install

Help
2009-03-02
2013-05-28
  • Kelton Joyner
    Kelton Joyner
    2009-03-02

    I tried to install php4dvd on my computer. I am running Apache/2.2.10 (Win32) PHP/5.2.8. I ran the install script and put root and my root password for mysql in the fields in the script. I removed the install folder and clicked on finish. I get the following error:
    Fatal error: Call to a member function isEditor() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\php4dvd\includes\movies.inc.php on line 155.
    What did I do wrong and how do I correct this problem.
    Kelton

     
    • rolf
      rolf
      2009-03-02

      It seems there is a $User object, but it is not of the type User, so it cannot run the function isEditor(). Can you post the output when you change this code:

          // Adding is only possible if the user is logged in and editor
          if(isset($User) && $User->isEditor()) {

      into:

          // Adding is only possible if the user is logged in and editor
          if(isset($User)) print_r($User);
          if(isset($User) && $User->isEditor()) {

      in the file 'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\php4dvd\includes\movies.inc.php' on line 155.

       
    • Kelton Joyner
      Kelton Joyner
      2009-03-02

      I get the same error message except now it is line 156.

      Fatal error: Call to a member function isEditor() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\php4dvd\includes\movies.inc.php on line 156

       
      • rolf
        rolf
        2009-03-02

        Well... I was expecting a print of the $User variable.

        What if you change this:

        if(isset($User)) print_r($User);

        into

        print_r($User); exit();

        What output do you see? Maybe check the source code of the page.

         
    • Kelton Joyner
      Kelton Joyner
      2009-03-02

      There doesn't seem to be a $User value. I put the line of code in and got a blank page, so I added echo('hello'); before the statement and it printed so the program is running to that point. One thing that I didn't mention in the first post is that none of the screens (login, ect.) appear. Only a white page with the error message.
      Kelton

       
      • rolf
        rolf
        2009-03-02

        I start wandering if you installed the database properly... It is very hard to debug this from a distance. From what I can see, is that it tries to find a valid user, but it cannot instantiate the user objects. Perhaps you can do some more debugging?

         
    • Kelton Joyner
      Kelton Joyner
      2009-03-02

      OK I checked the mysql database. I have the php4dvd database. It has 2 tables, movies and users. Movies has 26 rows. Users has 6 rows. Id, email, username, password, permission, last login. The values are id=1, email=admin@admin.com, username=admin, password=21232f297a57a5a743894a0e4a801fc3, permission=2, last login=0000-00-00 r my password00:00:00. There are no values in the movies table.
      Kelton

       
      • rolf
        rolf
        2009-03-02

        That is correct. It probably has something to do with the code or maybe the php/apache settings. Sorry, but it is very hard to help you search into the right direction.

        Can you try this code in index.php:

        line 33, after require_once("includes/login.inc.php"); insert:

        if(isset($User)) echo "user is set: [" + $User + "]";
        else echo "user is not set";

         
    • Kelton Joyner
      Kelton Joyner
      2009-03-02

      Additional info: I rebooted my computer then ran php4dvd again. This time I got the my collection screen with the login at the top. When I logged in with admin,admin I got this warning and error message:

      Warning: unserialize() expects parameter 1 to be string, object given in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\php4dvd\includes\login.inc.php on line 35

      Fatal error: Call to a member function isEditor() on a non-object in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\php4dvd\includes\movies.inc.php on line 155

      So it appears that initial problem is in the login.inc file or before. I did a refresh on the php4dvd and then only got a white screen with the error message, no warning message. I had to reboot again to get the my collection screen again.
      Kelton

       
    • Kelton Joyner
      Kelton Joyner
      2009-03-02

      I put the line of code in index.php and got a 0 printed before the error message.
      This looks like a really neat program and I would like to get it working.
      Kelton

       
    • rolf
      rolf
      2009-03-02

      Ok, this seems like the same problem as https://sourceforge.net/forum/forum.php?thread_id=2049043&forum_id=755194

      Maybe this can be a workaround: Open the common.inc.php file in the root of the project. Insert these lines BEFORE the line with session_start():

      require_once($loc."/lib/objects/DataObject.class.php");
      require_once($loc."/lib/objects/User.class.php");

      If this does not work, please try to install an other apache/mysql server configuration. I would suggest www.wampserver.com. This runs out of the box and gives me no issues like this.

       
    • Kelton Joyner
      Kelton Joyner
      2009-03-02

      I rebooted the computer again and looked at the my collection screen and just under the My DVD Collection title there is a line that say's user is not set. How do I get the user set? That may be to source of the problem.
      Kelton

       
    • Kelton Joyner
      Kelton Joyner
      2009-03-02

      OK. I have it working. I deleted apache, php, and mysql and installed wampserver. Don't know why the versions of apache, php, and mysql didn't work together.
      Thanks for your help
      Kelton

       
      • rolf
        rolf
        2009-03-02

        No problemo. Have fun!