When I run laravel command in terminal php artisan cache:clear
, I got error could not find driver (SQL: delete from "cache")
.
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
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.
if you use Linux os you should install PHP PDO extension and MySQL extension
if was not work that , you can install it with the following