Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

None of the supported PHP extensions (PgSQL, PDO_PgSQL) are available

i have enabled extension=php_pdo_pgsql.dll and extension=php_pgsql.dll in my php.ini file but still unable to get adminer to work.

and also sudo service apache2 restart

like image 542
NjFern Avatar asked Mar 02 '17 04:03

NjFern


People also ask

Which PHP extensions need to be enabled for PostgreSQL?

PHP 5.4 or higher is required: 5.4, 5.5, 5.6, 7.0, ... You need to chose between, PostgeSQL PHP extension and PostgreSQL PDO extension. You need to activate the extension you chose.

How to connect PHP to PostgreSQL database?

Connecting to Database php $host = "host = 127.0. 0.1"; $port = "port = 5432"; $dbname = "dbname = testdb"; $credentials = "user = postgres password=pass123"; $db = pg_connect( "$host $port $dbname $credentials" ); if(!

Does PostgreSQL support PHP?

PHP provides many functions for working directly with PostgreSQL databases. To connect to PostgreSQL using native functions, follow these steps: Use the following PHP code to connect to PostgreSQL and select a database.


1 Answers

sudo apt-get install php7.0-pgsql

 cd /etc/postgresql/9.5/main 

 sudo nano pg_hba.conf 

local   all             postgres                                peer

should be 

local   all             postgres                                md5

sudo service postgresql restart

then you good to go :)

like image 73
NjFern Avatar answered Oct 30 '22 22:10

NjFern