Description of Problem: flock($open_fp, LOCK_EX) always returns a false value (and fails to lock). Version-Release number of selected component (if applicable): php-4.0.6-13 How Reproducible: I used the following command-line script (but the bug occurs from within mod_php too): #!/usr/bin/php -q <?php if (!($fp = fopen('/tmp/lock.file', 'r'))) { die("couldn't open file to lock\n"); } else { flock($fp, LOCK_EX) or print "couldn't get lock!!\n"; print "HELLO\n"; sleep(5); print "GOODBYE\n"; flock($fp, LOCK_UN); fclose($fp); } ?> Additional Information: It was working fine in php-4.0.6-9.7.0
Created attachment 49807 [details] flock() test script
Thanks for the report. This seems to work OK in current release when the test script is corrected to pass 'w' to fopen; please reopen if there are still problems.