symfony / flex

Composer plugin for Symfony
MIT License
4.15k stars 181 forks source link

OPcache API is restricted by "restrict_api" #986

Open Soonz opened 1 year ago

Soonz commented 1 year ago

Hi,

I recently encoutered an error that I managed to fix, it happens in the BundlesConfigurator.php file at line 121 :

opcache_invalidate($file);

I couldn't run anything with it this way, I always had the error :

Warning: Zend OPcache API is restricted by "restrict_api"

I changed the line by @opcache_invalidate($file); and it worked fine.

Would have like to submit this as a definitive fix but it might be related to my hosting system.

This happened on a OVH hosting with PHP 8.1

Thanks.

nicolas-grekas commented 1 year ago

please send a PR

Soonz commented 1 year ago

I wanted to but I can't.

My "Create pull request" button is grayed out for some reason.

xcwxc69wxcwx9cxw9

I'm not familiar with GitHub, sorry.

Soonz commented 1 year ago

What I find odd is, why a warning stops the execution of the code ? The only thing I'm doing here is ignoring warnings.

This happened during the installation of EasyAdminBundle and completely stopped the process.

lyrixx commented 1 year ago

My "Create pull request" button is grayed out for some reason.

You need to choose another branch, just above the big yellow banner

image