简体   繁体   中英

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

In your terminal:

sudo apt-get install php5-pgsql

When installing finish

/etc/init.d/apache2 restart

And check your postgres db connection.

For PHP 7 it is:

sudo apt-get install php7.0-pgsql

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

DLL是用于Windows的,就像提到的“СвятославПавленко”一样。

sudo apt-get install php7.0-pgsql

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM