安装

Support for this functions are not enabled by default. To enable System V semaphore support compile PHP with the option --enable-sysvsem. To enable the System V shared memory support compile PHP with the option --enable-sysvshm. To enable the System V messages support compile PHP with the option --enable-sysvmsg.

User Contributed Notes

sparcbr at gmail dot com 05-Apr-2020 01:29
It should be mentioned that depending on the system, an module can be available.

On CentOS I just ran:
sudo yum install php73-php-sysvsem

then reload:
sudo service php-fpm reload (or apache, depending on your case)

and semaphore functions are now available.