skip to Main Content

When I run laravel command in terminal php artisan cache:clear, I got error could not find driver (SQL: delete from "cache") .

enter image description here

I have done some solution that I found like :

  • uncomment extension pdo_pgsql in php.ini
  • clear files in /storage/framework/cache directory
  • clear config.php, packages.php and services.php files in /bootstrap/cache directory
  • uninstall and install nginx, php and postgresql

None of them worked.

I migrate data using php artisan command is worked well. If I run php artisan route:cache, php artisan config:cache and php artisan view:clear, they are also worked well. Only php artisan cache:clear command got problem.

For additional information, this happened after I update my OS to Big Sur (11.1) and these are the version I am using.

  • nginx 1.19.6
  • php 7.3.24
  • postgresql 10.15
  • laravel 5.5.45

Please help me.

2

Answers


  1. Chosen as BEST ANSWER

    I found the solution. PHP cause this problem. Actually mac has preinstalled PHP and this was what I use. This PHP got trouble if we upgrade OS to Big Sur (11.1).

    I install PHP from homebrew. I use brew link to make homebrew PHP default. I also set the PATH variable. Restart my terminal and it works.


  2. if you use Linux os you should install PHP PDO extension and MySQL extension

    apt-get install php-mysql
    apt-get install php-pdo
    

    if was not work that , you can install it with the following

    apt-get install php-common
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search