dave0 / leaguerunner

Leaguerunner is a web-based application for managing scheduling, score submission and standings for an Ultimate Frisbee league.
GNU General Public License v2.0
15 stars 5 forks source link

Strange Fatal Error #57

Closed dave0 closed 14 years ago

dave0 commented 14 years ago

Originally filed by h07r0d on 2009-04-01T18:12:57

What steps will reproduce the problem?

  1. load main page
  2. ...
  3. ...

What is the expected output? What do you see instead? Login page

What version of the product are you using? On what operating system? latest snapshot

Please provide any additional information below. Fatal error: Call to a member function is_admin() on a non-object in /home/sudult/public_html/leaguerunner/Handler/Settings.php on line 19

My hosting provider recently rebuilt their server and this is now the error. I can't reproduce with a local LAMP installation.

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-07T15:20:34

It seems like the session is not being created properly. For the life of me I can't reproduce it on a local installation. http://www.sudburyultimate.com/leaguerunner/ is where I'm trying to host it. I've attached the conf file I'm using.

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-07T17:33:20

I've narrowed it down to the fact that for some reason, sess_read($key) in session.inc is NOT being called at the start. I've added craptonnes of echo statements and found that there's no time where $lr_session is actually created. I checked the DB and all session_cookie values are null, so there's no conflict there. What else can I look at? I can't think of any reason the session would not be created properly.

dave0 commented 14 years ago

Updated by trawna.com on 2009-04-07T18:17:00

Is session_set_save_handler in session.inc being called? Are there php.ini settings that might cause problems here? Is the directory where session files will be saved set properly, with correct permissions?

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-07T19:47:33

I get past session_set_save_handler, but when I echo the return value, it's empty.
The call is BOOL so I would expect a true/false. I'm getting a TRUE return on session_start() however.

I'm not 100% sure on the directory security. Which folders should I be checking? My limited understanding of the code so far tells me session info is cookie and mysql, not files.....but all the folder structure currently is the same as the rest of the site, and I'm not having any problems with phpbb3 or coppermine.

I didn't notice anything weird in the php config http://www.sudburyultimate.com/info.php

dave0 commented 14 years ago

Updated by kyledealmeida on 2009-04-07T19:58:26

Does your database support INNODB? I've been having similar issues on a server, and ran into problems with INNODB earlier, so I'm wondering if that has something to do with it?

dave0 commented 14 years ago

Updated by trawna.com on 2009-04-07T20:16:11

Can you explicitly test the return from session_set_save_handler against true and false (with ===, not ==)? I think that false is echoed as an empty string, so this would confirm the output of that function. Also, what version of PHP are you using?

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-07T22:22:43

RE: #5 I'm running 5.0.67-community through my hosting provider. They are not very cooperative on upgrades, so getting up to 5.1 probably isn't going to happen. I havent' seen any problems reading/writing db info, just this weird session problem.

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-07T22:58:18

RE: #6 if ($returnvalue === TRUE) { echo('true'); } else { echo('false'); } I get false for the explicit test. I'm not sure where I can find the reason for the fail though, it's just a bool return, not sure where I can find more info on the failure. PHP version 5.2.9 www.sudburyultimate.com/info.php has the phpinfo() call if that helps any.

dave0 commented 14 years ago

Updated by trawna.com on 2009-04-07T23:15:19

In the distributed .htaccess, there are a number of php_value settings. I'm thinking that the auto_start and save_handler ones are key to your situation. Our host doesn't provide the capability for setting these things in the .htaccess, so it had to be done elsewhere. php.ini is one option, or a call to ini_set somewhere in the code (before the call to session_set_save_handler.

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-08T12:31:44

Thanks for the tips. I checked the phpinfo on the site root and within the leaguerunner. Both are the same, so it looks like the host doesn't let me customize php with .htaccess either. I'll give the ini_set a try to start with. For the two values mentioned, currently: session.auto_start ON session.save_handler FILES

I assume they should be OFF and USER? I only have files/user/sqlite available.

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-08T13:12:43

That did it! I took the php_mod items from the .htaccess file and made a bunch of calls to ini_set in compatability.inc (figured that would be a decent spot) and we're golden!

Thanks so much for all the help.

dave0 commented 14 years ago

Updated by trawna.com on 2009-04-09T05:22:49

I think lr_configure_sessions might be a better place than compatibility.inc for those changes. It's also only called once, and it localizes the session stuff in one place. Do you have SVN access?

Anyone at OCUA have comments about why this was done in .htaccess in the first place? Are there PHP installations that allow these settings in .htaccess but not through code?

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-09T13:33:27

moved code into lr_configure_session. I don't have svn access right now, not sure if I should, since I'm still pretty new to php in general.

Although I wouldn't mind a branch for the Sudbury Ultimate Club as I'm making a few other modifications as well. We're using Phpbb3 and coppermine, so I'm adding some user account duplication code. Also, changing themes and such.

dave0 commented 14 years ago

Updated by dave0000 on 2009-04-15T12:42:40

I don't remember why they were done via htaccess... that was quite some time ago. It may have been that in older versions of PHP, some of the options weren't settable via ini_set?

Doing it as ini_set calls in lr_configure_session is probably a better idea unless we can come up with a reason to keep them in htaccess.

dave0 commented 14 years ago

Updated by h07r0d on 2009-04-21T04:26:42

the .htaccess file mentions php4 as the module to check against. That's probably why they were set using .htaccess, it wasn't possible at the time.

I haven't had any problems arise since this change, with leaguerunner, or any other app on the site.

dave0 commented 14 years ago

Updated by dave0000 on 2010-05-22T01:26:27

Original ticket set status to Verified (we converted to closed)