G2 Install Problem - "Call to a member function on a no

dspguy1

Joined: 2003-01-14
Posts: 45
Posted: Thu, 2004-12-30 18:45

I tried searching through the forums to get an answer but failed. I just got G2 from Sourceforge and went through the install process. I completed all 10 steps correctly and it seemed to work.

I then went to the gallery (main.php) and I got the following error:
Fatal error: Call to a member function on a non-object in /var/lib/apache/htdocs/gallery/modules/core/classes/GalleryTemplateAdapter.class on line 312

Can somebody please tell me what is wrong?

Thanks,
MT

----

Gallery URL (optional):
Gallery version: 2.0 Alpha 4
Webserver (with version): Apache 1.3.29
Datatabase (with version): MySQL Ver 8.40 Distrib 4.0.13, for pc-linux on i686
PHP version (eg 4.2.1): 4.3.2 (Zend Engine v1.3.0)
phpinfo URL (optional):
Graphics Toolkit(s):
Operating system: Linux
Web browser/version: Mozilla 1.7.1

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2004-12-30 18:55

no theme is loaded to display the page, which means something went wrong with the install.. if you PM me ssh/ftp access to your server and the G2 url I can take a look.

 
dspguy1

Joined: 2003-01-14
Posts: 45
Posted: Thu, 2004-12-30 20:48

Is there some way I can try to debug this on my own? If you can tell me what to look for, I should be able to look for it...

I don't have ability to change passwords and the sysadmin is not going to be around for some time.

Another thing to note is that I redid the whole install and I got a similar error (only this time it was complaining that errorHead.tpl was missing - and if you check the tar.gz file - it is missing)

Warning: stat(): Stat failed for /var/lib/apache/htdocs/gallery/templates/errorHead.tpl (errno=2 - No such file or directory) in /var/lib/apache/htdocs/gallery/modules/core/classes/GalleryPlatform.class on line 570

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2004-12-30 21:22

where did you get your tar.gz? perhaps try a clean install using a current nightly snapshot.. see the FAQ for snapshot locations.

 
dspguy1

Joined: 2003-01-14
Posts: 45
Posted: Thu, 2004-12-30 22:37

I downloaded the current build from:

http://galleryupdates.jpmullan.com/

and it stopped complaining about not finding errorHead.tpl. However, the fatal error still exists. Could this be related to my php/apache/mysql version?

Thanks,
MT

----

Gallery version: 2.0 Alpha 4
Webserver (with version): Apache 1.3.29
Datatabase (with version): MySQL Ver 8.40 Distrib 4.0.13, for pc-linux on i686
PHP version (eg 4.2.1): 4.3.2 (Zend Engine v1.3.0)
Operating system: Linux
Web browser/version: Mozilla 1.7.1

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2004-12-30 22:53

without access to your server i can't guess what went wrong. you can try to debug why _theme in GalleryTemplateAdapter doesn't seem to be getting set...

 
dspguy1

Joined: 2003-01-14
Posts: 45
Posted: Sat, 2005-01-01 20:03

I tried running main.php from the command line and it seems that there is a permissions problem. I'm including an error log along with this post.

I have g2data chmodded to 777 (as per the documentation). I did not create anything inside this folder - everything is owned by nobody:nobody.

In your past experience, what has caused the session files to be non-creatable?

Does this indicate some sort of a umask problem?
I created a test php file and read the default umask. It is set to 18 (which I'm guessing is 0x12).
If this is a umask problem, what should the correct umask be and should I change GalleryPlatform.class to adapt the umask?

Thanks,
MT

Warning: fopen(/home/gallery/g2data/sessions/6d664d76f731adda14cd1cf18f29a30b): failed to open stream: Permission denied in /var/lib/apache/htdocs/gallery/modules/core/classes/GalleryPlatform.class on line 341
Error
Error (ERROR_PLATFORM_FAILURE) :

    * in modules/core/classes/GalleryPlatform.class at line 377 (gallerystatus::error)
    * in modules/core/classes/GalleryPlatform.class at line 436 (unixplatform::openandlock)
    * in modules/core/classes/GallerySession.class at line 249 (unixplatform::concurrentwrite)
    * in modules/core/classes/GallerySession.class at line 160 (gallerysession::save)
    * in modules/core/classes/Gallery.class at line 284 (gallerysession::init)
    * in init.php at line 113 (gallery::initsession)
    * in main.php at line 32
 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-01-01 21:42

when you access G2 via the webserver then php runs as the webserver user.. sounds like user "nobody" in this case.. if you then try to run from the command line (as your own user) it won't have permission to write the files/dirs it created before as "nobody".. so the behavior you saw in that test is normal.

 
dspguy1

Joined: 2003-01-14
Posts: 45
Posted: Sun, 2005-01-02 19:02

ah, that makes sense.

So, how do you guys debug problems? Is there no way of running the php script on the command line to find out where it is choking?

thanks

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2005-01-03 08:53

The most straightforward way is to add print statements to the code to dump out extra information at run time. We do have some more sophisticated debugging tools like PhpED (but they cost money).

Can you post a directory listing for us? What do these commands return?

$ ls -al /home/gallery/g2data/sessions/
$ find /home/gallery/g2data -ls

The second entry might be quite long .. if it turns out to be really long, you can publish it on your site and put a link to it here.

That should give us an idea of how G2 is creating files and directories on your system so we can start narrowing down what's going wrong.