当我尝试创建数据库时
doctrine:database:create
有错误(mysql或postgresql):
Could not create database for connection named `symfony`
could not find driver
我的参数.yml:
parameters:
database_driver: pdo_mysql
database_host: 127.0.0.1
database_port: 3306
database_name: symfony
database_user: root
database_password: null
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: 1dffcb10ddfc2bbc4f211d773f2524557
database_path: null
当我试图将我的类映射到db时
php app/console doctrine:generate:entities Demos/BlogBundle/Entity/Post
php app/console doctrine:schema:update --force
有错误:
[PDOException]
could not find drive
在php.ini文件中取消注释
extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll
print_r(get_loaded_extensions())结果:
数组(... mbstring [35] => exif [36] => gd [37] => gettext [38] => mysql [39] => Phar [40] => pdo_mysql [41] => pdo_pgsql [42 ] => pgsql ...)
我发现http://www.php.net/manual/en/pdo.installation.php用户gerrywastaken写道,可能需要命令:
--with-pdo-mysql [= DIR] PDO:MySQL支持。 DIR是MySQL基本目录如果mysqlnd作为FOR传递,将使用MySQL本机本机驱动程序[/ usr / local]
我无法理解执行此命令的位置,或配置...
在php.ini配置中取消注释这些行后,您需要重新启动Web服务器