Pnsessionsetup problem

gerpsych wrote on Thursday, December 08, 2005:

Hi I am trying to run 2.8 on a suse 10 box with php and apache2. The server seems to work as does openemr for everything except the calendar when I get variations on …

Fatal error: Call to undefined function: pnsessionsetup() in /srv/www/htdocs/openemr/interface/main/calendar/includes/pnAPI.php on line 410

Any pointers would be gratefully received

Alan

sunsetsystems wrote on Thursday, December 08, 2005:

What PHP version?  If 5.x you’ll need to revert to PHP4 until OpenEMR is debugged for PHP5.

If you’re already running PHP4 then check your log file for an error or warning message preceding the one you listed.  It appears the include of pnSession.php failed for some reason.

– Rod
www.sunsetsystems.com

shortname wrote on Wednesday, December 28, 2005:

I am also running a SuSE system (OpenSuSE), and I had a very similar error message. I believe that changing the two include statements above pnSessionSetup() in the file /openemr/interface/main/calendar/includes/pnAPI.php to:

include ‘/srv/www/htdocs/openemr/interface/main/calendar/includes/pnSession.php’;

and

include ‘/srv/www/htdocs/openemr/interface/main/calendar/includes/pnUser.php’;

p.s. A little hint: if you’re using kwrite to edit pnAPI.php you can find the include statements I’m talking about easily by doing a search (not case sensitive) for pnSessionSetup() and then looking above the highlighted line for the include statements.

One last thing: This fix will eliminate the error messages, but for some reason, Session Initialization will probably still fail, I’m not sure why this is: but I’m working on it.

sunsetsystems wrote on Wednesday, December 28, 2005:

Hello?  PHP version?  :slight_smile:

– Rod
www.sunsetsystems.com

shortname wrote on Wednesday, December 28, 2005:

Rod,

If he’s using SuSE 10.0, then probably version 4.4.0-6.6

esears1 wrote on Thursday, December 29, 2005:

I wonder if it’s a permission problem?

dgardea wrote on Thursday, December 29, 2005:

We’re also encountering this exact same error
Fatal error: Call to undefined function: pnsessionsetup() in /srv/www/htdocs/openemr/interface/main/calendar/includes/pnAPI.php on line 410

on a SuSE 10.0 installation. It’s running PHP 4.4.0 and MySQL version 4.1.13

I have not tried the fixes described by shortname but am curious what you all come up with as a final conclusion.

lucky666 wrote on Friday, February 17, 2006:

Hi guys - had the same problem on my suse 10.0 - added a ‘./’ in the includes & that got rid of that error, but now also get the ‘Session initialization failed’ message after login.

Am using php v4.4.0 (Build date Sept 13 2005)

No errors showing in the apache2 logs.

Any suggestions?

andres_paglayan wrote on Friday, February 17, 2006:

by default php saves session data  on a /tmp dir,
reading php.ini file can be very useful,
make sure all settings related to session stuff makes sense, and if in doubt send a copy of the ini file. (after you read it)

lucky666 wrote on Wednesday, February 22, 2006:

Thanks Andres - checked it out - all seems OK - can see the sessions being created (& updated) in the tmp dir.

Am able to log in & all the other functions seem to be working normally, just the calendar seems to be failing with the ‘Session initialisation failed’ error - this happens in both the front page and under Administration --> Calendar Settings.

Have CHOWN’ed the entire dir structure to the appropriate apache2 user - still no luck.

Any other thoughts?

Thanks for the help

Phil

andres_paglayan wrote on Wednesday, February 22, 2006:

Try downloading a new copy from the repository,
It wouldn’t be the first time having a corrupted file causing problems.

lucky666 wrote on Thursday, February 23, 2006:

Well - one step closer - now no error message on the screen, but the calendar (& it’s management page) are simply blank.

Did as you suggested & got that result, so I deleted all files, dropped the d’base & re-installed from scratch - same thing

Am I being thick?

Everything except the calendar seems to hum along quite nicely.

??Worth another download from another site??

Thanks for your time on this

Phil

sunsetsystems wrote on Thursday, February 23, 2006:

The calendar page should not be blank unless there’s a PHP error.  You need to configure php.ini so that errors are logged somewhere, and then check wherever that is for relevant errors when you have a problem.

Trying to install OpenEMR without seeing the error messages is an exercise in futility.

– Rod
www.sunsetsystems.com

drbowen wrote on Thursday, February 23, 2006:

The pages will come up blank if you have not increased the memory in php.ini.

Default is 4 megs.  I increased mine to 64 megs and this problem went away.

Don’t ask me why.  On an initial install 4 meg sometimes works but on reinstalls it doesn’t. Try to increase the allowed maximum memory to 64 meg.

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing request data
memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)

Increase this last line to 64M

Sam Bowen

lucky666 wrote on Friday, February 24, 2006:

Thanks guys for the input.

Two things :-
1) I’m an idiot - watching the apache logs with an eagle eye, while the errors were going to syslog - sorry for wasting your time on that furfy.
2) Tracked down, killed the errors & got back to the ‘Session initialisation failed’ error again - went hacking my way through & caused a woefull mess.

Will delete, drop d’base, download a new copy, start from scratch & try to do a better job.

Thanks again for the help

Phil

drbowen wrote on Sunday, February 26, 2006:

Dear Phil,

Did dropping your database and reinstalling help fix your problem?

lucky666 wrote on Monday, February 27, 2006:

Gidday Sam

No such luck.

Got 2.8.1, cleaned out old version & installed from scratch - got a blank calendar in both the front & admin pages - found a couple of errors generated by pnAPI.php - fixed those & am now getting ‘Session initialisation failed’ on both those screens.

php.ini set with ‘error_reporting = E_ALL’ - getting lots of notices about undefined indices and variables in globals.php, but no errors.

Seem to be stuck - anyone else have an idea?

Thanks if you have

Phil

sunsetsystems wrote on Monday, February 27, 2006:

Offhand it appears to me you will get this message only if the following database query fails in interface/main/calendar/includes/pnSession.php:

------------------------------------------------

    $query = “SELECT $sessioninfocolumn[ipaddr]
              FROM $sessioninfotable
              WHERE $sessioninfocolumn[sessid] = '” . pnVarPrepForStore($sessid) . “’”;

    $result = $dbconn->Execute($query);
    if($dbconn->ErrorNo() != 0) {
        return false;
    }

------------------------------------------------

So you might try, for example, replacing the ‘return false;’ with something like ‘die($dbconn->ErrorMsg();’ and see if that reveals the cause.

– Rod
www.sunsetsystems.com

lucky666 wrote on Monday, February 27, 2006:

Thanks Rod - have followed your advice & it is now giving me ‘No database selected’

Checked sqlconf.php & it all looks OK.

Sorry, no idea where to go from here

Appreciate your help

Phil

sunsetsystems wrote on Monday, February 27, 2006:

Very strange.  Looks like adodb is having trouble where the native PHP MySQL interface is not.

I don’t like it that OpenEMR contains its own bundled-in adodb, and I REALLY don’t like that it contains it *twice* – two different versions!  This needs to be looked at, in particular to see what it would take to use the distribution’s native adodb drivers.  Has anyone looked at this?

What version of mysql do you have?

– Rod
www.sunsetsystems.com