I assume the short answer will be NO , from my "research" I found that there is currently no implementation of POSIX semaphores in PHP.
Bob Fanger has published an interesting workaround for converting strings to SysV semaphore keys, the disadvantage is that you have to implement the same algorithm in every code you need a semaphore.
What I eventually did was use flock() in the lock file.
Php
# open an exclusive lock $lock = fopen('/path/to/file.lock', 'w'); flock($lock, LOCK_EX);
Perl
use Fcntl qw(:flock);
I know that an additional lock file may seem redundant, but you can use LOCK_EX only in write mode, and sometimes I only need to read the file.
Note: flock() acts as a mechanism to lock the advisory file; if any other program tries to modify the file without calling flock() , it will succeed.
Ixai source share