koha-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-devel] Re: [Koha] premature end of script headers


From: Chris Cormack
Subject: [Koha-devel] Re: [Koha] premature end of script headers
Date: Fri, 19 Jan 2007 15:20:37 +1300
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)



I found the cause of the problem by running the script in the
shell. I could no longer connect to the MySQL database server
since I had changed the name of the database user.

Now the problem is fixed.
This raises a couple of issues:

1. Why is the admin login username (to the Intranet) the same as
   the database username? The two should be separate, esp. for
   security reasons.

It isnt, or at least it doesnt need to be. This is just the login to Koha until you set up a librarian and assign them as superuser. The librarians should all be logging in with their own user codes.

2. When the script that fails runs in the shell, I can clearly
   see the error:

   perl ./intranet/cgi-bin/mainpage.pl
DBI connect('eesv2pre5:localhost','kohaadmin',...) failed: Access denied for user 'kohaadmin'@'%' to database'Koha' at /usr/local/koha/intranet/modules/C4/Context.pm line 411 Can't call method "prepare" on an undefined value at /usr/local/koha/intranet/modules/C4/Koha.pm line 388.

   Surely the same error message should be sent to the Apache log, rather
than "premature end of script headers". I think the problem lies in the way Perl is being used. If Koha used mod_perl instead, this problem would not occur, since mod_perl can do things like ensure you have a valid database connection
   during Apache initialisation -- if there is a problem, mod_perl can be
   configured to abort the Apache startup. This would be a Good Thing (tm).
   Another Good Thing is mod_perl will run the scripts 100 x faster!

It is, did you check the koha-error_log.

There is nothing in the code to stop the error being sent, if its not in the error logs its something apache is doing.

Also Koha can use mod_perl ... the reason it doesnt by default is you dont have to run Koha with apache, any webserver will do.

Most of these things have been talked about in the past.

Chris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]