PHP checks the filesystem for file existing even if available in opcache and all opcache validations are disabled
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
The following code:
opcache.enable = 1
opcache.enable_cli = 1
opcache.file_update_protection = 0
opcache.validate_timestamps = 0
opcache.validate_permission = 0
opcache.validate_root = 0
opcache.file_cache = "/var/cache/opcache"
opcache.file_cache_only = 1
opcache.file_cache_consistency_checks = 0
will still trigger "File doesn't exist" even though opcache is correctly prepopulated. If I create an empty folder with an empty file, it works as expected.
See (reproduced in Docker, but this is not Docker specific, it's only convenient to reproduce there):
https://github.com/dkarlovi/docker-php-opcache-only/blob/main/Dockerfile#L15
Try it like here:
https://github.com/dkarlovi/docker-php-opcache-only/blob/main/README.md
PHP Version
PHP 8.2, 8.3
Operating System
Docker PHP image
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the behavior with the Dockerfile at the linked line and the commands in the linked README. Trace why PHP reports "File doesn't exist" despite the prepopulated opcache and disabled validations. Done means the reproduced setup can load the cached file without requiring an empty filesystem file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100