-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After installing Laravel version 11, I encountered an error stating that the SQLite driver was missing. Upon investigation, I realized that in Laravel 11, the .env file includes SQLite as the default database driver. #50484
Comments
What command did you use to create your Laravel application? |
@nunomaduro |
Working on the fix. |
Got the same issue there! Using:
|
This is now fixed. |
how to fixed? |
I encountered the same issue, and it was simply because the Check if it is installed, for example like this:
|
same here, It's happening to me |
@satrianovember @rostislavjadavan @saintadjie which OS are you all using? And which PHP version? |
PHP 8.3.4 |
|
@saintadjie @rostislavjadavan What's exactly is "happening" now? Can you share screenshots of the commands and issues you are getting? |
I no longer have any issues. I encountered the same error that was reported earlier, but in my case, it was due to a missing SQLite extension. I resolved the issue by installing it via Apologies if my initial post was unclear. |
sudo apt install php8.3-sqlite3 Fix! |
I have the same issue, but on Windows. I have uncommented the "extension=sqlite3" line in the php.ini file, but the problem persists. The sqlite dlls are in the ext folder of the php installation, but when I run "php -m | findstr pdo_sqlite", nothing is returned. How do I install those drivers on Windows? |
The easiest way is to modify the php.ini file and uncomment ;extension=pdo_sqlite. just remove ;(semi colon) and save the file. |
Thank you, it worked, I was using the wrong php.ini |
I got the same error follow the below steps to fix 1 : change the default DB connection to mysql in the .env file It worked at my side |
Thanks for this! This worked |
How to fix this in windows ? |
How this is fixed could you please explain |
How can I avoid launching the migration during my first installation of laravel 11, or at least define mysql as my default database connection |
I have same error but comment is not here mean your solve is it but the problem in my project what the solve |
I use following requirements, and encountered similiar problem
reproduce step
the problem will happen
I fixed by using https://wiki.archlinux.org/title/PHP#Sqlite |
thank you dear |
If you are having this issue, check if the PHP version you using matches the php.ini you are editing. Make a new terminal instance if you are switching from different PHP version. |
Not working |
If you are using Windows (10 in my case), have PHP installed and in your path env, it appears that you must have |
It was resolved for me adding |
Hello guys! I came across to the same problem. Even i switched the default database to mysql, on run php artisan comands i found this error. i tried same solutions posted before but to my surprise i found the problem on my case. I was editing the .env.example file rsrs on change the default db to mysql in my .evn production file no more error are showed. |
i used to get the same error, and everytime i just erase ";" in front of extension=pdo_sqlite and extension=sqlite3 on file php.ini. And serve laravel project like usual. |
Laravel Version
11
PHP Version
8.3.2
Database Driver & Version
mysql
Description
After installing Laravel version 11, I encountered an error stating that the SQLite driver was missing. Upon investigation, I realized that in Laravel 11, the .env file includes SQLite as the default database driver. However, as I only intended to use MySQL, this caused confusion initially.
Upon switching the database driver from SQLite to MySQL in the .env file, I noticed that the variables for the database username and password were commented out. This led to further confusion on my part.
I apologize for any confusion, but I'm unsure why these variables were commented out. It seems there might have been an oversight during the configuration process.
To resolve this, I've uncommented the lines for the database username and password, providing the necessary credentials for MySQL. This ensures that Laravel can connect to the MySQL database successfully.
Steps To Reproduce
Install fresh Laravel 11 using php 8.3.2 version, after finishing the installation composer gave me the sqlite driver error says
Illuminate\Database\QueryException
could not find driver (Connection: sqlite, SQL: PRAGMA foreign_keys = ON;)
at vendor\laravel\framework\src\Illuminate\Database\Connection.php:813
809▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
810▕ );
811▕ }
812▕
➜ 813▕ throw new QueryException(
814▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
815▕ );
816▕ }
817▕ }
1 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65
PDOException::("could not find driver")
2 vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php:65
PDO::__construct("sqlite:C:\laragon\www\L11\database\database.sqlite", Object(SensitiveParameterValue), ])
The text was updated successfully, but these errors were encountered: