how to link symfony to a postgresql database

1

I have a project in symfony, but I need it to be with a database in postgresql, but when I try it it gives me the following error

I do not have the xampp, in the machine I only have php and I work directly with the server that generates the symfony itself. How can I solve this problem?

    
asked by Andy Montalvo 03.05.2018 в 15:27
source

2 answers

0

First install the php-pgsql driver if it's serious linux

apt-get install php-pgsql

Then go to your nano run /etc/postgresql/9.xx/main/ph_hba.conf and look for the line that says:

# "local" is for Unix domain socket connections only
local   all             all                                     peer

and change it to:

# "local" is for Unix domain socket connections only
local   all             all                                     md5

Restart the apache and postgresql service

systemctl restart postgresql
systemctl restart apache2
    
answered by 03.05.2018 в 15:46
0

I had the same problem, I solved it this way:

  • in the file php.ini descomentarié line extension=php_pdo_pgsql.dll

  • in the file config.yml in the configuration of the doctrine you must have this:

I hope it serves you!

    
answered by 08.05.2018 в 17:29