Edit report at https://bugs.php.net/bug.php?id=81041&edit=1
ID: 81041
Comment by: lars at moelleken dot org
Reported by: mvorisek at mvorisek dot cz
Summary: Phpstan does not finish on Windows when opcache is
enabled
Status: Open
Type: Bug
Package: opcache
Operating System: *
PHP Version: 7.4.19
Block user comment: N
Private report: N
New Comment:
I see the same problem with Ubuntu.
Here is the content of an empty/broken opcache file. (I expected more content in the file)
> cat
> /var/tmp/php7.4/opcache/377076abe2ab6ee0c4975c2061101f72/home/comain/vdmg/App/scripts/githooks/StandardVdmg/PHPStanHelper/MeerxErrorFormatter.php.bin
OPCACHE377076abe2ab6ee0c4975c2061101f72���ib4kX���@P`�?k�p@������������ib�@X�~jkbF�[��#�Y/home/comain/vdmg/App/scripts/githooks/StandardVdmg/PHPStanHelper/MeerxErrorFormatter.phpA����>F�[��#�Y/home/comain/vdmg/App/scripts/githooks/StandardVdmg/PHPStanHelper/MeerxErrorFormatter.php
----------------------
- System-Info
----------------------
> cat /etc/issue
Ubuntu 18.04.6 LTS
> php -v
PHP 7.4.29 (cli) (built: Apr 21 2022 10:16:17) ( NTS )
> cat /etc/php/7.4/cli/conf.d/50-opcache.ini
```
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=1024
; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=64
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=100000
; The maximum percentage of "wasted" memory until a restart is scheduled.
;opcache.max_wasted_percentage=5
; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
opcache.use_cwd=1
; When disabled, you must reset the OPcache manually or restart the
; webserver for changes to the filesystem to take effect.
opcache.validate_timestamps=1
; How often (in seconds) to check file timestamps for changes to the shared
; memory storage allocation. ("1" means validate once per second, but only
; once per request. "0" means always validate)
opcache.revalidate_freq=0 ; For php-cli always validate php files
; File based OPCache (persistent opcode cache)
opcache.file_cache=/var/tmp/php7.4/opcache
opcache.file_cache_only=1 ; For php-cli use file-cache only
opcache.file_cache_consistency_checks=1
```
Previous Comments:
------------------------------------------------------------------------
[2021-12-29 23:34:46] cmb@php.net
> [â¦] and a lot of projects are CI tested against linux only.
If they are supposed to be compatible with Windows, that would be
sad. It shouldn't be hard to run unit tests on Windows, and even
tests requiring a Webserver should be viable.
------------------------------------------------------------------------
[2021-12-29 23:26:18] cmb@php.net
From the PHPStan 1.3.0 release announcement[1]:
| PHPStan now works when OPCache is enabled!
| Thanks to this commit: phpstan/phpstan-src@e30f446
Might be worth to give it try with PHPStan 1.3.0.
| [â¦] simply stop native windows support no longer needed these
| days [â¦]
Feel free to pursue the RFC process[2].
[1] <https://github.com/phpstan/phpstan/releases/tag/1.3.0>
[2] <https://wiki.php.net/rfc/howto>
------------------------------------------------------------------------
[2021-06-25 19:06:04] wfegeg dot wfwg at fff dot com
maybe php should do the same as bind and simply stop native windows support no longer needed these
days - so much wasted time and code smell to workaround a operating system with no justification
used as server
20 years ago virtualization and containers didn't exist but these days come on
------------------------------------------------------------------------
[2021-06-25 18:44:21] m at m dot cz
Can someone look at it? This may be a serious issue for every Windows platform as the problematic
configuration is default and a lot of projects are CI tested against linux only.
------------------------------------------------------------------------
[2021-06-09 10:17:59] m at m dot cz
So there is some opcache issue with file_cache_only.
On Windows, I collected the trace logs using xDebug 2.9.x, see https://github.com/mvorisek/phpstan-src/commit/2f14329c69e457b494bab868b6d2c8247e283dc4#diff-3aea6cf619d0b900724dd43ee0706fcd5e1dfc6af9e6a455a98c8540c20bac2bR13
config, and the the issue was present even with xdebug. Please be aware, that it produces a trace
log with size around 100 GB and it takes about 2 hours to complete.
------------------------------------------------------------------------
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=81041
--
Edit this bug report at https://bugs.php.net/bug.php?id=81041&edit=1