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

[Bug]: Warning: Zend OPcache API is restricted by "restrict_api" configuration directive #47562

Closed
5 of 8 tasks
roman-doubrava opened this issue Aug 28, 2024 · 3 comments · Fixed by #47567
Closed
5 of 8 tasks
Labels

Comments

@roman-doubrava
Copy link

roman-doubrava commented Aug 28, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

Dear Nextcloud Support,
we have tried to install the Nextcloud Versions 28 and 29 on PHP 8.2.22 using the installation script "https://download.nextcloud.com/server/installer/setup-nextcloud.php" and both fail with the same error before the main install dialog appears where we can input the database connection settings:

Warning: Zend OPcache API is restricted by "restrict_api" configuration directive in /www/doc/www.data-business.de/www/cloud/lib/private/Config.php on line 218
Config file has leading content, please remove everything before "<?php" in config.php
Fatal error: Uncaught Error: Typed static property OC::$server must not be accessed before initialization in /www/doc/www.data-business.de/www/cloud/index.php:98 Stack trace: #0 {main} thrown in /www/doc/www.data-business.de/www/cloud/index.php on line 98

The Nextcloud Version 27.1.11 works on PHP 8.2.22 without any issues, however when we try to upgrade to 28 after a successfull install it fails with the same error above.

Our hosting provider has a setting restrict_api for all customers and is not willing to change this:
opcache.restrict_api /www/doc/local

When we comment out the line /www/cloud/lib/private/Config.php on line 218 [//opcache_invalidate($file, false);] it works.

Best regards

Steps to reproduce

  1. Install Nextcloud 28 or 29 on PHP 8.2.22 where opcache.restrict_api is set to a restricted folder
  2. Or Upgrade from Nextcloud 27 to 28

Expected behavior

Fresh install should work
Upgrade for 27 to 28 should work

Installation method

Community Web installer on a VPS or web space

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

No response

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@roman-doubrava roman-doubrava added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 28, 2024
@joshtrichards
Copy link
Member

When we comment out the line /www/cloud/lib/private/Config.php on line 218 [//opcache_invalidate($file, false);] it works.

Does putting an @ in front of it instead of commenting it out work in your environment?

We're already doing that elsewhere (around line 288 in that version of the same file you can see it). The one you're encountering was added recently. And the suppression for exactly your situation was overlooked there it looks like.

joshtrichards added a commit that referenced this issue Aug 28, 2024
Make changes recently added via #44230 match #8188 to avoid failures in restricted hosting environments.

Fixes #47562

Signed-off-by: Josh <josh.t.richards@gmail.com>
@joshtrichards joshtrichards added 3. to review Waiting for reviews regression and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Aug 28, 2024
@solracsf solracsf changed the title [Bug]: Fresh Installation Nextcloud 28+29 on PHP 8.2.22 Fatal error: Uncaught Error: Typed static property OC::$server must not be accessed before initialization [Bug]: Warning: Zend OPcache API is restricted by "restrict_api" configuration directive Aug 28, 2024
@roman-doubrava
Copy link
Author

Yes putting an @ in front works as well, thank you very much.

@joshtrichards
Copy link
Member

Glad to hear it! It'll be fixed in upcoming maintenance releases.

backportbot bot pushed a commit that referenced this issue Aug 30, 2024
Make changes recently added via #44230 match #8188 to avoid failures in restricted hosting environments.

Fixes #47562

Signed-off-by: Josh <josh.t.richards@gmail.com>
backportbot bot pushed a commit that referenced this issue Aug 30, 2024
Make changes recently added via #44230 match #8188 to avoid failures in restricted hosting environments.

Fixes #47562

Signed-off-by: Josh <josh.t.richards@gmail.com>
backportbot bot pushed a commit that referenced this issue Aug 30, 2024
Make changes recently added via #44230 match #8188 to avoid failures in restricted hosting environments.

Fixes #47562

Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants