appstract / laravel-opcache

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

Php 8 with latest laravel #133

Open kavvson opened 3 years ago

kavvson commented 3 years ago

php artisan opcache:status

TypeError

Illuminate\Http\Client\PendingRequest::withHeaders(): Argument #1 ($headers) must be of type array, null given, called in /var/www/prod/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php on line 390

at vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php:311 307▕ 308▕ @param array $headers 309▕ @return $this 310▕ / ➜ 311▕ public function withHeaders(array $headers) 312▕ { 313▕ return tap($this, function ($request) use ($headers) { 314▕ return $this->options = array_merge_recursive($this->options, [ 315▕ 'headers' => $headers,

  +17 vendor frames

18 artisan:37 Illuminate\Foundation\Console\Kernel::handle()

benjivm commented 2 years ago

Also seeing this: PHP 8.1, Laravel 8.8.0

Stunext commented 2 years ago

I have seen that many have problems with the Http facade. You could try using the exclude array in the opcache.php file in the config folder, although I don't know if this array allows you to indicate the path to an entire folder to exclude. I should clarify that I have not had that problem in both laravel 8 and laravel 9.

In general, when the library has failed me, it is when I try to add it to an already advanced project. Sometimes I create a clean Laravel project and then I add little by little the code of the base project until I detect where the file that cannot be compiled is.