Answers for "there was an error with the cache: serialization of 'symfony\component\httpfoundation\file\file' is not allowed - /var/www/utip-symfony/vendor/phpfastcache/phpfastcache/lib/phpfastcache/core/pool/driverbasetrait.php"

PHP
1

Serialization of 'SymfonyComponentHttpFoundationFileFile' is not allowed

For Vich Uploader,
you need to use implements Serialize

  use Serializable;

  
  Class EntityName implements Serialize
{
  
  //code here
  
      public function serialize()
    {
        return serialize($this->getId());
    }

    public function unserialize($serialized)
    {
        $this->id = unserialize($serialized);
    }
}

It works for me.
Posted by: Guest on July-13-2020
0

Serialization of 'SymfonyComponentHttpFoundationFileFile' is not allowed

For Vich Uploader
you need to use implements and public function serializable/unserializable.

  class NameEntity implements Serializable
{
  
  //code here 
  
  public function serialize()
    {
        return serialize($this->getId());
    }

    public function unserialize($serialized)
    {
        $this->id = unserialize($serialized);
    }
}

It works for me.
Posted by: Guest on July-13-2020

Browse Popular Code Answers by Language