Moslah
Moslah

Reputation: 39

error create database in symfony 4?

sudo php bin/console doctrine:database:create

In AbstractMySQLDriver.php line 125:

  An exception occurred in driver: could not find driver


In PDOConnection.php line 50:

  could not find driver


In PDOConnection.php line 46:

  could not find driver


doctrine:database:create [--shard SHARD] [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

please help .

Upvotes: 0

Views: 901

Answers (2)

yosrai guesm
yosrai guesm

Reputation: 31

Check if your php.ini file has the lines :

extension=pdo_mysql
extension=pdo_pgsql
extension=mysqli

Upvotes: 0

Ralf Gerald
Ralf Gerald

Reputation: 58

You have to enable PDO extension.

If you are on a Windows machine look in your php.ini file and uncomment extension=php_pdo_mysql.dll. The path to your php.ini file can be found by looking at your phpinfo().

Debian/Ubuntu

PHP 5 sudo apt-get install php5-mysql

PHP 7 sudo apt-get install php7.0-mysql

You will then need to ensure the module is enabled:

sudo phpenmod pdo_mysql

Then restart Apache:

sudo service apache2 restart 

Upvotes: 1

Related Questions