Estou tentando gerar o banco de dados pelo doctrine, porém aparece os erros abaixo. P.S verifiquei os outros tópicos no fórum e não achei a solução neles.
Código de EntityManagerFactory
<?php
namespace Alura\Doctrine\Helper;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
class EntityManagerFactory
{
//criando um gerenciador de entidades para projeto
//annotations
/**
* @return EntityManagerInterface
* @throws \Doctrine\ORM\ORMException
*/
public function getEntityManager(): EntityManagerInterface
{
$rootDir = __DIR__ . '\..\..';
$config = Setup::createAnnotationMetadataConfiguration(
[$rootDir . '\src'],
true
);
$connection = [
'driver' => 'pdo_sqlite',
'path' => $rootDir . '/var/data/banco.sqlite'
];
return EntityManager::create( $connection, $config);
}
}
Mensagem cmd
! [CAUTION] This operation should not be executed in a production environment!
!
Creating database schema...
In ToolsException.php line 34:
Schema-Tool failed with Error 'An exception occurred in driver: SQLSTATE[HY000] [14] unable to open data
base file' while executing DDL: CREATE TABLE Aluno (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, nome
VARCHAR(255) NOT NULL)
In AbstractSQLiteDriver.php line 67:
An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file
In PDOConnection.php line 31:
SQLSTATE[HY000] [14] unable to open database file
In PDOConnection.php line 27:
SQLSTATE[HY000] [14] unable to open database file
orm:schema-tool:create [--dump-sql]
Modulos php ao executar php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
filter
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib