The problem was that the file was opened for reading and it was locked exclusiv.
$_fp = @fopen($file, "r"); flock($_fp, LOCK_EX); After change to LOCK_SH it works. What is strange is that not all systems have this behavior. On linux with php 4.3.4 as module this was not a problem. !?! Why?? ----- Original Message ----- From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Armand Turpel" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, February 28, 2004 8:04 PM Subject: Re: [PHP] flock problem > Is the file on an NFS-mounted filesystem? flock() in 4.3.3 works fine. > > -Rasmus > > On Sat, 28 Feb 2004, Armand Turpel wrote: > > > Hi, > > > > flock($_fp, LOCK_EX ); > > > > return always false. I'm relativily shure that the file to flock is not flocked > > elsewhere. php 4.3.3 is running as cgi on linux. > > What is going wrong? > > > > thanks for an answer. > >