Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: dodos26 on August 22, 2022, 03:59:45 PM

Title: OPcache API is restricted by "restrict_api"
Post by: dodos26 on August 22, 2022, 03:59:45 PM
I have thousands of bugs since yesterday. Dont change web files.

2: Zend OPcache API is restricted by "restrict_api" configuration directive
File: /www/Sources/Load.php
Line: 2824
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Kindred on August 22, 2022, 10:05:13 PM
Talk to your host and/or disable caching
Title: Re: OPcache API is restricted by "restrict_api"
Post by: dodos26 on August 24, 2022, 02:10:28 PM
My provider says it didn't change anything. and the mistakes disappeared the next day.  :o
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Doug Heffernan on August 24, 2022, 02:19:05 PM
Quote from: dodos26 on August 22, 2022, 03:59:45 PMI have thousands of bugs since yesterday. Dont change web files.

You mean error messages, right?

Anyways, this error is related to Zend OPCache API access being restricted.

https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.restrict-api

The OPCache setting in php.ini need to be edited and set to blank:

i.e:

opcache.restrict_api=""
Quote from: dodos26 on August 24, 2022, 02:10:28 PMMy provider says it didn't change anything. and the mistakes disappeared the next day.  :o

I take it that the issue has been solved then? In that case I am marking this as solved. In case I misunderstood you, please feel free to mark it as unsolved.
Title: Re: OPcache API is restricted by "restrict_api"
Post by: dodos26 on December 05, 2022, 02:31:21 PM
It again back 2.0.19:
2822: // Invalidate the opcode cache
2823: if (function_exists('opcache_invalidate'))
==>2824:     opcache_invalidate($cachedir . '/data_' . $key . '.php', true);
2825:
2826: if (function_exists('apc_delete_file'))
2827: @apc_delete_file($cachedir . '/data_' . $key . '.php');

/Sources/Load.php
Created on every page refresh, one for Guest one for Me (admin user) in this same time.
What i did i was using incognito trubu in chrome for guest test.

Bez tytułu.png
Bez tytułu2.png
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Kindred on December 05, 2022, 03:32:15 PM
Quote from: Kindred on August 22, 2022, 10:05:13 PMTalk to your host and/or disable caching
Title: Re: OPcache API is restricted by "restrict_api"
Post by: dodos26 on January 11, 2023, 04:18:24 PM
He insists they didn't change anything. Please help.. let some developer clearly admit that it is the fault of the service provider. I installed a test new clean forum, the problem I still have, I informed them about it.

"On the OVHcloud side, the configuration was not changed. In order to make the proper configuration, I recommend contacting a forum system specialist.

If the information provided does not exhaust the topic, I invite you to describe your expectations in detail in response to my message."

QuoteAnd where is such an option, I looked for it and I do not see such a contact category.

QuoteContacting a specialist for your forum system is independent of OVHcloud. If in doubt about this contact, I recommend contacting your IT specialist.

QuoteAfter all, I wrote that I contacted the developers.. Who the fool are you trying to make, I gave you a link to a discussion where the dev says that something in the opcache_invalidate area must have been blocked.
I looked through php ini and I see clearly in black and white it is limited.. A few years ago, the problem suddenly appeared, of course, when I wrote to you, the problem disappeared and you claimed that nothing had changed. And now you've blocked something again and pretend that you found a fool who will let go..

*Links removed as requested by user -Lex *
https://www.simplemachines.org/community/index.php?topic=583355.0

The setting should be:
opcache.restrict_api=""
And you put limits
opcache.restrict_api /home/ovh/fpm7.4/opcache-status.php /home/ovh/fpm7.4/opcache-status.php
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Eleglin on July 01, 2024, 04:31:33 AM
Dodos, for your information, i can confirm this problem for SMF 2.0 and 2.1 with this provider.
OVHcloud too. Don't know if you found a solution or did you just disable cache ?
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Arantor on July 01, 2024, 05:28:29 AM
Well, the issue is that SMF cache files then get cached by opcache and the correct method of flushing the opcache isn't available because of their configuration blocking it.

They could remove the entry in opcache.restrict_api, they could set it to the Sources folder to let SMF use it when it needs to. Or you can turn off file based caching because you can't trust it to not be out of date when it expires.
Title: Re: OPcache API is restricted by "restrict_api"
Post by: dodos26 on July 04, 2024, 09:29:31 AM
Quote from: Eleglin on July 01, 2024, 04:31:33 AMDodos, for your information, i can confirm this problem for SMF 2.0 and 2.1 with this provider.
OVHcloud too. Don't know if you found a solution or did you just disable cache ?
I bought a VPS and set up my own server. The problem is that they changed it by quietly pushing the new regulations to be signed during the renewal.
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Oldiesmann on July 04, 2024, 11:21:17 AM
If it's a VPS then you can edit the PHP configuration yourself.
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Arantor on July 04, 2024, 11:38:52 AM
Quote from: Oldiesmann on July 04, 2024, 11:21:17 AMIf it's a VPS then you can edit the PHP configuration yourself.

Stop making sense. We all know that that won't fly around here when there's raging to be done about SMF and how terrible it is (given past post history) when it is the host at fault.
Title: Re: OPcache API is restricted by "restrict_api"
Post by: Eleglin on July 04, 2024, 02:11:35 PM
Ok. So I will do without cache. I understand it s a restriction by the host and not SMF fault. 
That said, really love SMF2.1. I just made the upgrade and this is always better. 
Thanks for your answers 👍