New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling include() on locked file on PHP 7.4 #36132
Comments
Since this varies by PHP version, isn't it a bug in PHP 7.4 instead of Symfony? |
Add
This is due to a PHP error rather than Symfony. |
would this work around it also? |
Yes, it works, but I can't cause a issue. This occurs sporadically, I also confirm this error, so I added the operator |
is_readable workaround doesn't work for me. For me it happens only when "srcMyKernelxxxDebugContainer.php" doesn't exist. Probably something connected with lock handling was changed in PHP 7.4 as you mentioned. I did another try with simple script:
PHP 7.3:
PHP 7.4
It looks like PHP 7.3 allows to include locked file, PHP 7.4 doesn't. |
OK thanks, can you please open a PHP bug report? Maybe this will ring a bell to someone there? |
Alternatively, we could have a lock file next to the one we include. |
Well, not a PHP bug, see https://bugs.php.net/bug.php?id=79398#1584896555 (TL;DR include is subject to mandatory file locking on Windows as of PHP 7.4.0). |
It solved the issue. |
This PR was merged into the 4.4 branch. Discussion ---------- [HttpKernel] fix locking for PHP 7.4+ | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #36132 | License | MIT | Doc PR | - As explained in https://bugs.php.net/79398 Commits ------- f618b98 [HttpKernel] fix locking for PHP 7.4+
Issue still happens for symfony 5.0.5 BUT ONLY when using composer install|update.(happens always though) |
Symfony version(s) affected: 4.4.5
Description
On PHP 7.4 (Windows) first booting of container (HttpKernel) causing the following PHP Notice:
Issue looks similar to #35242 but in different place in the code.
On PHP 7.3 (Windows) notice is not thrown.
For both versions of PHP error_reporting is set to E_ALL.
PHP Version:
It's calling include on cachePath which is locked and not released.
How to reproduce
Create empty project with "symfony/symfony" ^4.4
Create dummy kernel
Callboot kernel
During first start (when cache doesn't exist) the following note will be visible:
The text was updated successfully, but these errors were encountered: