-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix "Nextcloud is not allowed to use the OPcache API" warning #31415
Conversation
Signed-off-by: Mickey Knox <mickey@netfreaks.org>
@MichaIng would you please have a look here? 👍 |
Many thanks, looks good. Makes sense to not break only because of a trailing slash 👍. |
/backport to stable23 |
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
Hi, I just updated to 23.0.3, but I am still seeing the error message in the admin panel: "The PHP OPcache module is not properly configured" - even everything is set up properly. |
This only fixes the case where one is using something like |
This aims to fix "Nextcloud is not allowed to use the OPcache API" warning being displayed even though OPcache is configured and running fine.
With the latest update to 23 the above warning appeared but there were no warnings or any issues before the update.
So i dug into this and found the string comparison to be causing the warning: in my setup
opcache.restrict_api
has a trailing slash whereasOC::$SERVEROOT
has not. 🙈To be honest i wasn't sure wether to add a slash to the server root for comparison or to remove the trailing slash and in the end i decided for the latter. Also please note that i'm not an every day PHP developer at all so don't mind if this attempt of solving the issue is not the right way to fix it at all. I'm just trying to follow the idea of submitting patches instead of just filing bugs and it was quite interesting to read through all of this. 😉
Why is there a trailing slash in my
opcache.restrict_api
and why dont i just remove it? I'm running a self-hosted Nextcloud instance on a server that is otherwise managed using Froxlor Server Management Panel. With this management panel theopcache.restrict_api
gets somewhat dynamically configured per virtual host using a placeholder{DOCUMENT_ROOT}
wich in turn has this trailing slash.