Skip to content
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

Error when running "php spark migrate -all" #189

Closed
spitfire64 opened this issue Apr 12, 2020 · 11 comments
Closed

Error when running "php spark migrate -all" #189

spitfire64 opened this issue Apr 12, 2020 · 11 comments

Comments

@spitfire64
Copy link

I have installed myth and I try to migrate you tables using the command "php spark migrate -all", but I get this error in my cmd:

Type: Error
Message: Class 'SQLite3' not found
Filename: C:\xampp\htdocs\ci4i\vendor\codeigniter4\framework\system\Database
SQLite3\Connection.php
Line Number: 89

@MGatner
Copy link
Collaborator

MGatner commented Apr 12, 2020

Sounds like you don’t have the SQLite PHP extension installed. Please review the CodeIgniter 4 server requirements.

@spitfire64
Copy link
Author

spitfire64 commented Apr 12, 2020

I have according to my xampp file "phpinfo.php"
It says
PDO Driver for SQLite 3.x: Enabled
SQLite Library: 3.24.0

I am on PHP 7.3.5, Codeigniter 4.0.2 and I have installed Myth/auth today.

@MGatner
Copy link
Collaborator

MGatner commented Apr 12, 2020

Sometimes the database error occurs if a Composer installation fails. Can you verify if you install via Composer? Also make sure you are viewing phpinfo.php from the command line since PHP often runs different versions from browser and CLI, and you need spark to have access to the extension.

@spitfire64
Copy link
Author

spitfire64 commented Apr 13, 2020

MGatner, I have now installed SQLite and still get the following error when I run "php spark migrate -all":
CodeIgniter CLI Tool - Version 4.0.2 - Server-Time: 2020-04-13 03:43:26am

Running all new migrations...
An uncaught Exception was encountered

Type: Error
Message: Class 'SQLite3' not found
Filename: C:\xampp\htdocs\ci4i\vendor\codeigniter4\framework\system\Database
SQLite3\Connection.php
Line Number: 89

agungsugiarto: Thank you. I might try it as a Plan B.

@spitfire64
Copy link
Author

I temporarily renamed the Test folder and run "php spark migrate -all". Now I got the this message:
CodeIgniter CLI Tool - Version 4.0.2 - Server-Time: 2020-04-13 03:48:18am

PHP Fatal error: Cannot declare class Myth\Auth\Commands\CreateGroup, because t
he name is already in use in C:\xampp\htdocs\ci4i\vendor\myth\auth\src\Commands
CreateGroup.php on line 49

And when I now check my db I have 16 Myth tables. Maybe they was migrated the first time I run the command and got the SQLite error. I don't know.

Anyway, time to move on.

@ddoomenbsu
Copy link

In php.ini uncomment the following lines does solve the issue for me.

extension=sqlite3
extension=pdo_sqlite

@ghost
Copy link

ghost commented May 4, 2020

I myself just ran into this issue and solved it by running 2 commands

sudo apt install php7.2-sqlite
sudo systemctl restart apache2

hope it helps!

@youhunt
Copy link

youhunt commented Apr 3, 2021

In php.ini uncomment the following lines does solve the issue for me.

extension=sqlite3
extension=pdo_sqlite

It's work for me too. Thanks a lot...

@iwanharli
Copy link

In php.ini uncomment the following lines does solve the issue for me.

extension=sqlite3
extension=pdo_sqlite

Its work, thanks

@FOSSALGO
Copy link

In php.ini uncomment the following lines does solve the issue for me.

extension=sqlite3
extension=pdo_sqlite

Thanks. its work. Terimakasih sejauh ini berhasil dengan cara sederhana

@rizkyhaksono
Copy link

In php.ini uncomment the following lines does solve the issue for me.

extension=sqlite3
extension=pdo_sqlite

Thanks. It work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants