[英]ubuntu php_pgsql.dll not found
I installed Apache2 on Ubuntu 14.04, with php 5.5.9. 我在Ubuntu 14.04上用PHP 5.5.9安装了Apache2。 I see the Apache screen, the phpinfo screen, but php can't connect to postgresql.
我看到了Apache屏幕,即phpinfo屏幕,但是php无法连接到postgresql。
I get "Fatal error: Call to undefined function pg_connect()" when I try. 尝试时出现“致命错误:调用未定义函数pg_connect()”。
My php.ini acording to 'phpinfo();' 我的php.ini对应于'phpinfo();' is:
是:
Loaded Configuration File /etc/php5/apache2/php.ini
In php.ini I have a [PostgreSQL] section, but no 在php.ini中,我有一个[PostgreSQL]部分,但没有
;extension=php_pgsql.dll
and the file doesn't exist. 并且文件不存在。
The modules loaded include mod_php5, but no *pgsql... 加载的模块包括mod_php5,但没有* 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. 并检查您的postgres数据库连接。
For PHP 7 it is: 对于PHP 7,它是:
sudo apt-get install php7.0-pgsql
So, now you can do not uncomment lines in php.ini
因此,现在您不能在
php.ini
取消注释行
DLL是用于Windows的,就像提到的“СвятославПавленко”一样。
sudo apt-get install php7.0-pgsql
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.