appstract / laravel-opcache

Laravel Package for OPcache
MIT License
1.34k stars 119 forks source link

Clearing opcache error #115

Closed discoverlance-com closed 4 years ago

discoverlance-com commented 4 years ago

I wanted to use opcache and so I set up the following config in my php.ini file.

opcache.enable=1
opcache.memory_consumption=512
opcache.interned_strings_buffer=64
opcache.max_accelerated_files=32531
opcache.validate_timestamps=0
opcache.save_comments=1

I then installed the opcache package but running opcache:clear or opcache:status gets me the following error.

 Argument 1 passed to Illuminate\Http\Client\PendingRequest::withHeaders() must be of the type array, null given, called in /var/www/laravel/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php on line 272

  at vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php:230
    226|      *
    227|      * @param  array  $headers
    228|      * @return $this
    229|      */
  > 230|     public function withHeaders(array $headers)
    231|     {
    232|         return tap($this, function ($request) use ($headers) {
    233|             return $this->options = array_merge_recursive($this->options, [
    234|                 'headers' => $headers,

      +18 vendor frames 
  19  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
discoverlance-com commented 4 years ago

Sorry, did not check earlier Issues, just checked and a similar one was fixed by clearing config.

I also fixed mine by clearing my config because it was already cached. php artisan config:clear