appstract / laravel-opcache

Laravel Package for OPcache
MIT License
1.33k stars 118 forks source link

Cannot redeclare Composer\Autoload\includeFile() (previously declared in /code/vendor/composer/ClassLoader.php:442) #106

Closed mpyw closed 4 years ago

mpyw commented 4 years ago

Possibly related to #75.

opcache.dups_fix seems to be able to solve this problem, but it doesn't work as expected...

image image

We don't see any errors in the terminal, but we confirmed Sentry error report has been actually sent.

ovanschie commented 4 years ago

Maybe exclude the autoloader in config?

mpyw commented 4 years ago

My current attempt:

image

But I believe it be excluded by default.

mpyw commented 4 years ago

Resolved by:

- base_path('vendor/composer/composer/src/Composer/Autoload/ClassLoader.php')
+ 'Autoload'

However, we'd better add notPath directive in addition to exclude.

genesiscz commented 4 years ago

@ovanschie could you fix this in place so we dont have to visit this issue on every other project, please? I'd make a PR, but not sure this is sufficient and safe enough to just jump into it

ovanschie commented 4 years ago

I still never had this issue before, so if anyone can confirm one of the above things works, i'll add it.

genesiscz commented 4 years ago

I confirm the base path works on every single project of mine, all of them running Laravel 7

ovanschie commented 4 years ago

I confirm the base path works on every single project of mine, all of them running Laravel 7

and just 'Autoload' ??

genesiscz commented 4 years ago

yes, seems to be working