Bug #80726 [Opn]: With any PHP 8 version I get crash running more than one CLI
| From: | rfcastro at porto dot ucp dot pt | Date: | Wed, 10 Feb 2021 13:38:36 +0000 |
| Subject: | Bug #80726 [Opn]: With any PHP 8 version I get crash running more than one CLI | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-232040@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80726&edit=1
ID: 80726
User updated by: rfcastro at porto dot ucp dot pt
Reported by: rfcastro at porto dot ucp dot pt
Summary: With any PHP 8 version I get crash running more than
one CLI
Status: Open
Type: Bug
Package: JIT
Operating System: Windows Server 2012 R2
PHP Version: 8.0.2
Block user comment: N
Private report: N
New Comment:
So for Windows I should set in the PHP.INI opcache.cache_id=1 so any code will run always in
opcache.cache_id=1
And manual if I have to run multi-codes at the same time, I should set each extra one with a
opcache.cache_id=2 and opcache.cache_id=3, etc...
Is this correct?
And thank you for your time.
Previous Comments:
------------------------------------------------------------------------
[2021-02-10 13:34:55] cmb@php.net
opcache.cache_id defaults to an empty string (the documentation is
wrong about the "1" default). This default is different from any
other ID.
Note that ID is an arbitrary *string* (the documentation is
correct about that).
------------------------------------------------------------------------
[2021-02-10 12:17:58] rfcastro at porto dot ucp dot pt
Right now I have it working placing the opcache.cache_id=2 on runtime on the main running script and
the rest I have no opcache.cache_id, so I was guessing it would use 1 by default.
I see now in the PHP.ini there is an "opcache.cache_id=" commented. So should I place an
opcache.cache_id=1 in the PHP.INI, or will it always used by default the opcache.cache_id=1 and
since my main running code is on opcache.cache_id=2 it will work.
------------------------------------------------------------------------
[2021-02-10 12:09:19] cmb@php.net
On non Windows systems, OPcache instances are never shared between
unrelated PHP processes; only forked childs share the instance
with their parent. Since there is FPM, this model works very
well. On Windows, there is no FPM (and generally no fork(3)), so
all PHP processes using the same PHP version and SAPI share an
OPcache instance (until there is no more PHP process within that
group, in which case the OPcache instance is destroyed). This is
required to have only a single OPcache instance for (F)CGI. This
does not really make sense for typical CLI scripts, but there may
be cases where this is desired even for CLI. Thus, the
opcache.cache_id INI option has been introduced, so that it's
possible to control the sharing of instances.
It might be sensible to automatically use separate OPcache
instances for CLI, if opcache.cache_id is not set, but that would
be a behavioral change.
I wonder, though, whether different OPcache instances are supposed
to be required in your case, or whether there is a bug in the JIT
implementation.
------------------------------------------------------------------------
[2021-02-10 10:26:20] rfcastro at porto dot ucp dot pt
Yes, using the two different caches works.
But is this possible automatically?
------------------------------------------------------------------------
[2021-02-09 20:25:32] cmb@php.net
Would it work if you used two different opcache.cache_id, e.g.
php -dopcache.cache_id=1 file1.php
php -dopcache.cache_id=2 file2.php
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80726
--
Edit this bug report at https://bugs.php.net/bug.php?id=80726&edit=1