Docker Community Forums

Share and learn in the Docker community.

I can't install php-pgsql in container

(Nharmando) #1


This is my first post here, but I don’t know if this is the right place where I can post this new topic.

I am new working with docker, i like it, but in this moment I can conect my container from php7.0 to another with postgresql.

I get in my containter: docker exec -it php703 bash

but when I try with: apt-get install php7.0-pgsql

I get this message:

root@3ad3cc6fcc4b:/var/www/html# apt-get install php7.0-pgsql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php7.0-pgsql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘php7.0-pgsql’ has no installation candidate

I don’t know what to do and I am getting this another one:

Fatal error: Uncaught Error: Call to undefined function pg_connect()

I understand that the container inlude 1 debian 9 but no working when I try to install php7.0-pgsql

Could you please help?

thank you in advance

(Alisonalonso) #2

instead of

apt-get install php7.0-pgsql


docker-php-ext-install pgsql

(Nharmando) #3

Thank you alisonalonso for your response,

It worked within the conatiner:

apt-get install php7.0-pgsql