Edit report at https://bugs.php.net/bug.php?id=79751&edit=1
ID: 79751
Comment by: cmswares dot com at gmail dot com
Reported by: buschmann at nidsa dot net
Summary: "VirtualProtect() failed" entries in apache
error.log
Status: Open
Type: Bug
Package: opcache
Operating System: Windows Server 2019 64bit
PHP Version: 8.0.0alpha1
Block user comment: N
Private report: N
New Comment:
Confirmed on PHP 8.2.0 / Windows 10 (Apache/2.4.48 (Win64) OpenSSL/1.1.1l PHP/8.2.0). Experienced
when using default opcache settings. phpinfo() shows opcache.jit_buffer_size = 0 by
default. A setting that isn't present by default in php.ini. When I change that to e.g. 16M
from the default 0, the errors in Apache's error.log no longer appear when restarting httpd.
For the record, the error is:
> VirtualProtect() failed [87] The parameter is incorrect
...and I would get some 450-500 of these entries in one long queue (with no timestamp or other
information aside the above line), following:
> [mpm_winnt:notice] [pid 8332:tid 588] AH00354: Child: Starting 500 worker threads.
My production server is running PHP 8.1.4 on Centos 7 and also has the default
opcache.jit_buffer_size = 0. However, there are no errors on httpd restart. (N.B.
I'd love to know if that should be changed or not. Per documentation, 0 disables JIT --
although I still see opcache.jit tracing.)
Then, I assume this is related to the fact that Apache/Windows uses mpm_winnt while
Linux defauls to mpm_prefork, and this issue is specific to mpm_winnt and the
instantiation of child workers.
Previous Comments:
------------------------------------------------------------------------
[2022-12-12 05:54:28] pavlusha23 at gmail dot com
I have this problem on PHP 8.1.12
In my case, the php_svm extension was to blame. After disabling it, the problem disappeared.
opcache.jit works fine after that, but if XDebug is enabled, then opcache.jit is turned off, as
described in the documentation.
P.S. Test with 8.1.12 TS x64 + Windows 10 Pro 22H2 + php_svm 0.2.3
------------------------------------------------------------------------
[2022-12-12 05:50:43] pavlusha23 at gmail dot com
In my case, the php_svm extension was to blame. After disabling it, the problem disappeared.
opcache.jit works fine after that, but if XDebug is enabled, then opcache.jit is turned off, as
described in the documentation.
------------------------------------------------------------------------
[2022-07-22 17:01:26] php at protopia dot co dot uk
I am also having this issue with "php 8.1.7 win64 vs16" on windows 10 with "apache
2.4.54 win64 vs16".
AFAIK these are both the latest versions.
Disabling JIT does prevent the issue, however this is a workaround not a fix as (presumably) JIT
should be working for this combination.
------------------------------------------------------------------------
[2022-02-10 20:55:48] schreck06 at aol dot com
$> php -v
PHP 8.1.2 (cli) (built: Jan 19 2022 10:18:23) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies
with Xdebug v3.1.3, Copyright (c) 2002-2022, by Derick Rethans
Windows Server 2022
Build 20348.473
---
When starting the webserver (Apache) the error log is being spammed with:
VirtualProtect() failed [...] Incorrect parameter
---
Solved the issue by adding a line to the php config:
>> php.ini
[opcache]
opcache.jit=off
---
auto_globals_jit=Off
...does result in a performance loss while disabling 'opcache.jit' doesn't noticably
------------------------------------------------------------------------
[2022-01-12 07:43:14] a_wert_z at gmx dot de
Same here.
Version: 8.1.1
I came from upgrading a PHP7 installation on Windows tzo PHP8.1
Because of dependencies in the Apace installation I have to use the x32 Version of apache and PHP.
But the problem says the same.
Hundreds of enties in error.log
"VirtualProtect() failed [87] The parameter is incorrect"
opcache was enabled with CLI
opcache.enable=1
opcache.enable_cli=1
disabling opcache solves the issue with the log file, but the performance is much worth than the
PHP7 installation
------------------------------------------------------------------------
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=79751
--
Edit this bug report at https://bugs.php.net/bug.php?id=79751&edit=1