Click to See Complete Forum and Search --> : has anybody setup apache
scoutt
Jun 2nd, 2001, 02:04 PM
I was trying to setup apache on my machine (win98). I have it setup correctly (I think). well I can run any php script and cgi script. but my problems is that when I run my cgi script I get a flock error
"flock() unimplemented on this platform at library/routines.pl line 688"
ok I know what flock is and the file is using flock. How do I setup apache to run this? or do I have to do something to perl to run it? I have "ActivePerl-5.6.0.616-MSWin32-x86-multi-thread" installed on my machine. could that be the problem? how do I implement flock?
parksie
Jun 2nd, 2001, 02:44 PM
flock isn't implemented in Perl because AFAIK it doesn't exist or have any kind of relevance on a DOS platform.
If you just comment out any references to it it should work.
scoutt
Jun 2nd, 2001, 03:53 PM
thanks Parksie, so what you are saying is that because I'm on a win32 machine as opposed to unix/linux it won't run flock? I will just have to comment them out then and hope it still works, should though.
thanks
parksie
Jun 2nd, 2001, 05:22 PM
I think so. I've not used POSIX systems for a while so I'm a little rusty but that seems to be the case.
Anyway, on Win32 any file open for writing is automatically locked, and files open for reading can't be opened for writing, although you can read from them (unless you use overlapped I/O but I doubt Perl makes any use of that because it's specialist).
scoutt
Jun 2nd, 2001, 05:45 PM
I tried to comment those lines out and it will run but it won't right to those files it needs to. so I can't add any body to the DB if need to be. or make variable changes. what can I do to make it work so I can change variables or something?
parksie
Jun 2nd, 2001, 05:49 PM
Do you have a code sample? Is this something you wrote or something you got from elsewhere?
scoutt
Jun 2nd, 2001, 09:11 PM
ya I got it from somewhere else. in the admin area of the script it has a link to change system variables ( script variables) but I can't change them because it is locked without the flock, he he :)
open(LOCK_FILE, ">$require_path/$file_handle/$lock_file");
flock(LOCK_FILE, 2) if ($flock == 1);
tha tis a sample of one of the routines for flock. I think that maybe the main one. as all the scripts inquire this script
parksie
Jun 2nd, 2001, 09:15 PM
It looks like what it's doing is getting an exclusive lock (like a Mutex on Win32) on a file, so that nothing else can get it. This way it can guarantee that the current process is the only one using that file, even for reading.
scoutt
Jun 2nd, 2001, 09:25 PM
I think you have it right. I remember reading that in one of the readme files. so how do I get around this, if not it ain't no big deal cause I just want to play around with the colors of the script. I know the script already works.
parksie
Jun 2nd, 2001, 09:27 PM
At the very beginning try setting $flock=0
scoutt
Jun 2nd, 2001, 10:52 PM
same error as before. no change
parksie
Jun 3rd, 2001, 05:00 AM
:( Hmm. Sorry, no idea :( Maybe comp.lang.perl has more info?
scoutt
Jun 3rd, 2001, 11:18 AM
thanks anyway Parksie, it was worth a shot.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.