# I can't install php-pgsql in container

**URL:** <https://forums.docker.com/t/i-cant-install-php-pgsql-in-container/54667>\
**Category:** General\
**Created:** [July 24, 2018, 12:57am UTC](https://forums.docker.com/t/i-cant-install-php-pgsql-in-container/54667 "2018-07-24T00:57:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nharmando](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@nharmando](https://forums.docker.com/u/nharmando)\
**Post date:** [July 24, 2018, 12:57am UTC](https://forums.docker.com/t/i-cant-install-php-pgsql-in-container/54667/1 "2018-07-24T00:57:53Z")

</div>

hello,

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

---

<div class="post-metadata">

**Author:** ![alisonalonso](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/alisonalonso/32/20485_2.png) [@alisonalonso](https://forums.docker.com/u/alisonalonso)\
**Post date:** [July 25, 2018, 9:26pm UTC](https://forums.docker.com/t/i-cant-install-php-pgsql-in-container/54667/2 "2018-07-25T21:26:57Z")

</div>

instead of

```
apt-get install php7.0-pgsql

```

Try

```
docker-php-ext-install pgsql
```

---

<div class="post-metadata">

**Author:** ![nharmando](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@nharmando](https://forums.docker.com/u/nharmando)\
**Post date:** [August 8, 2018, 7:45pm UTC](https://forums.docker.com/t/i-cant-install-php-pgsql-in-container/54667/3 "2018-08-08T19:45:48Z")

</div>

Thank you alisonalonso for your response,

It worked within the conatiner:

> apt-get install php7.0-pgsql

Regards
