I've read numerous posts about Semaphore issues, but none appear to be related to this particular issue. I am running Apache 2.4 and PHP 7.1 as part of Zend Server CE, and when starting the Apache service, the following fatal error shows up in the Apache error log:
ZShmStorage(): Fatal error: failed to allocate semaphore. Permission denied
I'm guessing that is related to shared memory storage, but I'm unclear ...
- what it is actually trying to allocate the semaphore for
- where to look for configuration relating to said semaphore
I thought maybe it was related to the Zend Cache, so I made sure that the permissions looked correct for the [ZendServerPath]/tmp/datacache.
I also thought maybe it was related to the PHP Sessions, so I made sure that the directory specified for the session.save_path in the [ZendServerPath]/etc/php.ini file had proper permissions as well.
I'm unsure where else to look, as there doesn't appear to be any discussions (that I've found) relating to this, but instead it's all about available space and whatnot. In the off chance that it was related to something that borked during allocation, I went ahead executed ipcs -s and noted that there were ~20 Semaphore Arrays present while the Zend Server was running. I stopped the service and ran ipcs -s again -- no Semaphore Arrays were left lingering. Restarted the Zend Server service and the error was encountered again and ~20 Semaphore Arrays were also reallocated.
Any assistance or info to point me in the right direction would be appreciated.
I know this is too late to help @amorio, but maybe it'll help someone else.
The error is specifically from
ZShmStorage(), which means it's not apache or php's fault. It really doesn't help that the error message is a bit misleading.A bit more context on the error, at least in my case. I'm betting it's the same using php(-cgi).
Zend Server installed to
/usr/local/zend.I ran into this same issue on
ZendServer 9.1.10onUbuntu 16.04. In my case, I had to fix permissions on/usr/local/zend/tmp/datacachesowww-data(apache user) had write access./usr/local/zend/etc/conf.d/datacache.iniis where the save path is defined.