|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-02-28 14:26 UTC] aschmidt at anamera dot net
Description: ------------ I have a Windows Service (PHP 7.4 CLI), plus two IIS web sites, configured to run under the same Windows User ID with network privileges, because they need to access a certain network share. One web site was using PHP 7.3, and one web site PHP 7.4 (because it's a development/staging site). In the 7.4 php.ini "cache_id" is set. When I attempt to run the first web site also under 7.4, then scripts will start failing, due to "Fatal Error Cannot create mutex". I'm assuming, since both IIS sites (with different application code versions) now share the same PHP version and UserID, this results in a clash? If so, would the solution be to allow different/unique "cache_id"s to be configured in the .user.ini of each IIS site, rather than only being able to configure a common one in the system-wide php.ini? PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 22 03:00:01 2025 UTC |
> Yes, the mutex log entry is not helpful at all. Yes, that should be fixed. > Can you please clarify if your suggestion is to assign an entire > unique PHP.ini via environment variable. That can be an option, but my idea was more like using the environment variable in php.ini, e.g. opcache.cache_id=${OPCACHE_ID} Would that work for you? Changing to PHP_INI_PERDIR might generally make sense, though, but it appears that would be the only OPcache setting with that changeability.That's a helpful suggestion. The tricky part is that Windows sets Environment Variables "per User", which is the same for all sites in my scenario. With IIS 10 there's an option that will support setting "per Pool" Environment Variables. However, even in prior IIS versions, the Application Pool Name itself is available as an environment variable, so one can use: opcache.cache_id=v74_${APP_POOL_ID} I've activated the above and initial tests have not yet caused any Mutex errors.Two closing comments: a) Here's my working cache_id setting which will also cover CLI environments (where an AppPool ID doesn't exist), and further making it unique per PHP version to avoid the possibility of version clashes: opcache.cache_id="v"PHP_MAJOR_VERSION""PHP_MINOR_VERSION"_${APP_POOL_ID}" b) Please do note that the necessity of the above disproves the assertion/assumption that in my scenario there should not have been any Mutex problems in the first place.