Skip to content
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

Opcache clear sometimes fails with a fatal error #350

Open
KorvinSzanto opened this issue Apr 12, 2017 · 4 comments
Open

Opcache clear sometimes fails with a fatal error #350

KorvinSzanto opened this issue Apr 12, 2017 · 4 comments

Comments

@KorvinSzanto
Copy link
Contributor

This line in the FileSystem driver will sometimes fail with a fatal error in environments where the opcache api is restricted using the opcache.restrict_api configuration. This issue has plagued some of the niche members of our community and has caused them to manually modify this dependency by hand.

Should we make this line @opcache_invalidate($path, true) instead? I think another worse option is to eval the contents of the file instead of include.

@ghost
Copy link

ghost commented Apr 12, 2017

Another possibility would possibly be to add a check for opcache.enable => On in https://github.com/tedious/Stash/blob/master/src/Stash/Driver/FileSystem.php#L239

@KorvinSzanto
Copy link
Contributor Author

@sylphidlw That makes a little sense, but I think the issue these users are having a lot of the time is that they DO have opcache enabled, they just have api access restrictions. That does bring up a point that I somehow spaced though, we can just directly check that opcache.restrict_api value.

@zeefarmer
Copy link

zeefarmer commented Apr 12, 2017

@KorvinSzanto,

That was also a suggestion here.

opcache.restrict_api
Allows calling OPcache API functions only from PHP scripts which path is started from specified string. The default "" means no restriction.

So if you first checked whether or not opcache is enabled, then check the value of opcache.restrict_api for anything other than "", then disable the API functions.

@tedivm
Copy link
Member

tedivm commented Feb 25, 2022

If anyone wants to take this on the recommend solution is to have it throw an error when the system is in this state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants