Gossamer Forum
Home : Products : DBMan : Installation :

"flock() unimplimented on this platform" (Xitami)

Quote Reply
"flock() unimplimented on this platform" (Xitami)
Hi all,
I just installed Xitami on my PC under Windows95. I ran a couple of test scripts successfully on it - but when I ried to run DBman, I got this error:
"fatal error: flock() not supported on this platform".

I'm using active Perl 5.00503. Anyone know the solution and/or the cause?
Many thanks...
Alan33
Quote Reply
Re: "flock() unimplimented on this platform" (Xitami) In reply to
I do know that flock is not used on some servers and perhaps not with using Win98.

In your .cfg file there is a line:

$db_use_flock = 1;

Try just setting this to

$db_use_flock = 0;

and see if that clears your error so you can continue.

Hope this helps Smile
Quote Reply
Re: "flock() unimplimented on this platform" (Xitami) In reply to
Lois,
Many thanks for the suggestion. It makes sense!! I set flock to '0'.
Now, at least *something* (not much)happens...
The script now runs - or starts to...
But it starts up, displaying the record-data entry form! and it won't go any further. Is that perhaps because I disabled flock?
The script works fine on my ISP's unix server. I downloaded the whole directory structure to the cgi-bin under Xitami. (didn't alter anything in the scripts). Other scripts run okay in the Ixami environment(they are much simpler scripts, that don't use flock). My textbooks say that flock calls a unix function. Maybe that's why it doesn't work under Xitami. Should the script run okay with flock disabled?

Thanks again,

A

[This message has been edited by Alan33 (edited April 22, 2000).]
Quote Reply
Re: "flock() unimplimented on this platform" (Xitami) In reply to
The script should run fine with flock disabled, especially if you're just running it on your home computer and you're the only one working with the files. The purpose of flock (which stands for file lock) is to prevent multiple users from accessing the file at the same time, causing a possible corruption of the file. But if you're using it just on your home computer to test out DBMan, you're the only one accessing the files and you should be fine.

What exactly happens when you access the script? What do you see?


------------------
JPD






Quote Reply
Re: "flock() unimplimented on this platform" (Xitami) In reply to
JP, Happy Easter!

It's almost working now - after I changes the URLs in the cfg and html.pl files to relative paths.

But one big problem remains: when I run the script under xitami, it opens with the add_record form! (It should open with the Log-on form.)

The scripts and all related files and the direcory structure are identical to those on my web server. Now there's a puzzle...

I think I'll put the kettle on...

Alan

[This message has been edited by Alan33 (edited April 23, 2000).]

[This message has been edited by Alan33 (edited April 23, 2000).]

[This message has been edited by Alan33 (edited April 23, 2000).]
Quote Reply
Re: "flock() unimplimented on this platform" (Xitami) In reply to
The fact that you get the add form is quite puzzling. I'm not sure why that happens.

The normal problem with xitami is that people get the home page instead of the login screen. This may be your problem, too, although I'm not sure.

Go into auth.pl.

In sub auth_check_password, delete

Code:
my ($server_auth) = $ENV{'REMOTE_USER'} | | $ENV{'AUTH_USER'};

In sub auth_check_permissions, change

Code:
if ($ENV{'REMOTE_USER'} | | $ENV{'AUTH_USER'}) {
$username = $ENV{'REMOTE_USER'} | | $ENV{'AUTH_USER'};
}
else {
($userid =~ /^([A-Za-z0-9]+)\.\d+$/) ? ($username = $1) : return (0,0,0,0,0);
}

to

Code:
($userid =~ /^([A-Za-z0-9]+)\.\d+$/) ? ($username = $1) : return (0,0,0,0,0);

See if that works any better.


------------------
JPD






Quote Reply
Re: "flock() unimplimented on this platform" (Xitami) In reply to
Carol,
It works now!! :-) Thanks!!

How necessary is that code we altered? I mean, should I reverse the changes when I finally upload the perfected script?

Alan


[This message has been edited by Alan33 (edited April 24, 2000).]

[This message has been edited by Alan33 (edited April 24, 2000).]

[This message has been edited by Alan33 (edited April 24, 2000).]
Quote Reply
Re: "flock() unimplimented on this platform" (Xitami) In reply to
The code I had you removed is for those who have .htaccess files in the file directory. These files are the ones that cause a little window to come up where a user can enter a userid and password before they can access the files in a directory. (Have you seen those?)

If you're not using .htaccess, you won't need those lines at all.


------------------
JPD








[This message has been edited by JPDeni (edited April 25, 2000).]