Results 1 to 13 of 13

Thread: has anybody setup apache

  1. #1
    scoutt
    Guest

    has anybody setup apache

    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?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    scoutt
    Guest
    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

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    scoutt
    Guest
    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?

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Do you have a code sample? Is this something you wrote or something you got from elsewhere?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    scoutt
    Guest
    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

    Code:
    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

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9
    scoutt
    Guest
    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.

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    At the very beginning try setting $flock=0
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11
    scoutt
    Guest
    same error as before. no change

  12. #12
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Hmm. Sorry, no idea Maybe comp.lang.perl has more info?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  13. #13
    scoutt
    Guest
    thanks anyway Parksie, it was worth a shot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width