Rodrigo
Rodrigo

Reputation: 5129

ubuntu php_pgsql.dll not found

I installed Apache2 on Ubuntu 14.04, with php 5.5.9. I see the Apache screen, the phpinfo screen, but php can't connect to postgresql.

I get "Fatal error: Call to undefined function pg_connect()" when I try.

My php.ini acording to 'phpinfo();' is:

Loaded Configuration File   /etc/php5/apache2/php.ini

In php.ini I have a [PostgreSQL] section, but no

;extension=php_pgsql.dll

and the file doesn't exist.

The modules loaded include mod_php5, but no *pgsql...

I guess the proxy in my institution has blocked something?

[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

Upvotes: 0

Views: 3949

Answers (3)

Harijs Krūtainis
Harijs Krūtainis

Reputation: 1270

DLL's are for windows, do as "Святослав Павленко" mentioned.

sudo apt-get install php7.0-pgsql

Upvotes: 0

For PHP 7 it is:

sudo apt-get install php7.0-pgsql

So, now you can do not uncomment lines in php.ini

Upvotes: 1

SarDau Mort
SarDau Mort

Reputation: 174

In your terminal:

sudo apt-get install php5-pgsql

When installing finish

/etc/init.d/apache2 restart

And check your postgres db connection.

Upvotes: 2

Related Questions