My server uses NFS (Network File System), and I'm unable to use PHP's flock() -function. Is there a way to lock files on an NFS or is there a need to do so?
Nfs – File locks on an NFS
filesystemslockingnetwork-sharenfs
Related Topic
- Linux – df in linux not showing correct free space after file removal
- Linux – nfs file access statistics
- Nfs – Modifying NFS (XFS) File Attributes from within Windows
- Nfs – iSCSI and NFS file locking and concurrency
- Nfs – How to test whether fcntl() locks work with the NFS setup
- Linux – flock fails on shared NFS for exclusive blocking locks from 2 different maschines
- Nfs: enabling file locking (flock)
Best Answer
The manual page
flock(2)
had been out of date for a long time, but has since been updated to say (emphasis mine):That is from the official man-pages web site, http://man7.org/linux/man-pages/man2/flock.2.html which shows the new version from man-pages 4.00
Linux 2.6.12 was released in 2005.
This was originally meant to be a comment on janneb's answer, but I didn't have the reputation at the time. The doc update happened in 2014: http://git.kernel.org/cgit/docs/man-pages/man-pages.git/commit/man2/flock.2?id=e449654fdb3f19aafc569df47d12bffdf6276236