From e2ed7e6716f9564fcd8b13b823519baaa7256662 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 16 Jul 2019 21:14:57 +0200 Subject: Allow multiple cache instances per user/host on Windows Formerly, there was at most a single OPcache instance per user and the so called system ID (which is determined from the PHP version). Sometimes multiple OPcaches might be desired, though, particularly for unrelated CLI scripts, which may even be necessary (e.g. for our test suite in parallel mode). We therefore introduce a new INI directive `opcache.cache_id` which allows to configure independent OPcache instances for the same user. We also use `GetUserNameW()` instead of `php_win32_get_username()`, because the latter retrieves the user name encoded in the `default_charset`, which can obviously yield different results for different charsets, leading to OPcache "incompatibilities". Slightly worse, some characters may not even be encodeable in the `default_charset` and would be replaced by question marks, which could result in different users sharing the same OPcache. We also refactor, and re-use existing APIs to avoid duplicated code. --- php.ini-development | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'php.ini-development') diff --git a/php.ini-development b/php.ini-development index eb30bd389e..fd96f43534 100644 --- a/php.ini-development +++ b/php.ini-development @@ -1851,6 +1851,10 @@ ldap.max_links = -1 ; errors. ;opcache.mmap_base= +; Facilitates multiple OPcache instances per user (for Windows only). All PHP +; processes with the same cache ID and user share an OPcache instance. +;opcache.cache_id= + ; Enables and sets the second level cache directory. ; It should improve performance when SHM memory is full, at server restart or ; SHM reset. The default "" disables file based caching. -- cgit v1.2.1