1
resposta

Erro a importar arquivo de projeto

Vinicius, bom dia! Ao importar o projeto e seguir a Aula 2 do curso de MVC, recebi a mensagem de erro no console:

nsouza@nsouza-pc:/var/www/html/mvc$ php -S localhost:8000 -t public
[Sun Jul  5 07:57:22 2020] PHP 7.4.3 Development Server (http://localhost:8000) started
[Sun Jul  5 07:58:01 2020] 127.0.0.1:37872 Accepted
[Sun Jul  5 07:58:01 2020] PHP Fatal error:  Uncaught PDOException: could not find driver in /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27
Stack trace:
#0 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(27): PDO->__construct()
#1 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php(39): Doctrine\DBAL\Driver\PDOConnection->__construct()
#2 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(362): Doctrine\DBAL\Driver\PDOSqlite\Driver->connect()
#3 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1449): Doctrine\DBAL\Connection->connect()
#4 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(892): Doctrine\DBAL\Connection->getWrappedConnection()
#5 /var/www/html/mvc/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(888): Doctrine\DBAL\Connection->executeQuery()
#6 /var/www/html/mvc/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(178): Doctrine\ORM\Pe in /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php on line 70
[Sun Jul  5 07:58:01 2020] 127.0.0.1:37872 [500]: GET /listar-cursos.php - Uncaught PDOException: could not find driver in /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27
Stack trace:
#0 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(27): PDO->__construct()
#1 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOSqlite/Driver.php(39): Doctrine\DBAL\Driver\PDOConnection->__construct()
#2 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(362): Doctrine\DBAL\Driver\PDOSqlite\Driver->connect()
#3 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(1449): Doctrine\DBAL\Connection->connect()
#4 /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(892): Doctrine\DBAL\Connection->getWrappedConnection()
#5 /var/www/html/mvc/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(888): Doctrine\DBAL\Connection->executeQuery()
#6 /var/www/html/mvc/vendor/doctrine/orm/lib/Doctrine/ORM/EntityRepository.php(178): Doctrine\ORM\Pe in /var/www/html/mvc/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractSQLiteDriver.php on line 70
[Sun Jul  5 07:58:01 2020] 127.0.0.1:37872 Closing
1 resposta

Olá, Nilo. Sua extensão pdo_sqlite não está habilitada. :-)

Basta habilitá-la que tudo deve funcionar.