1

When i'm try to create db with

doctrine:database:create

There are errors(mysql or postgresql):

Could not create database for connection named `symfony`
could not find driver

my parametrs.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

When i'm trying to map my classes to db

php app/console doctrine:generate:entities Demos/BlogBundle/Entity/Post
php app/console doctrine:schema:update --force

there are error:

[PDOException]         
  could not find drive

lines uncomment in the file php.ini

extension=php_pdo_mysql.dll
extension=php_pdo_pgsql.dll

print_r(get_loaded_extensions()) result :

Array (... mbstring [35] => exif [36] => gd [37] => gettext [38] => mysql [39] => Phar [40] => pdo_mysql [41] => pdo_pgsql [42] => pgsql ... )

i found http://www.php.net/manual/en/pdo.installation.php user gerrywastaken wrote, that there maybe need commands:

--with-pdo-mysql[=DIR] PDO: MySQL support. DIR is the MySQL base directoy If mysqlnd is passed as DIR, the MySQL native native driver will be used [/usr/local]

i can't understand where execute this commands, or configure...

meteor
  • 658
  • 1
  • 9
  • 19
  • That command at the bottom is the php compilation command. If this is an initial LAMP server setup. If not, try this site's guides. http://www.tecmint.com/install-apache-mysql-php-on-redhat-centos-fedora/ – Moylin Aug 09 '13 at 20:14
  • This solved same problem for me - http://stackoverflow.com/questions/13375061/installing-pdo-driver-on-mysql-linux-server – Stone Cold Aug 09 '13 at 22:24

1 Answers1

1

You need to restart your web server after uncommenting these lines in php.ini configuration

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
atrichkov
  • 450
  • 3
  • 6