Docker Community Forums

Share and learn in the Docker community.

Your PHP installation appears to be missing the PostgreSQL extension which is required by WordPress with PG4WP

I am installing wordpress with postgres pg4wp, but it is giving the following error:
Your PHP installation appears to be missing the PostgreSQL extension which is required by WordPress with PG4WP.

Help-me please!

Hi

You need to provide more info.
1- What does your Dockerfile look like (if used)
2- If you use compose, please provide it

Please provide as much info as posible on how you use/start the wordpress container

Hello!
My docker-compose.yml:

version: ‘2.0’

services:
wp:
image: wordpress
environment:
- WORDPRESS_DB_USER=postgres
- WORDPRESS_DB_PASSWORD=Postgres2018!
- WORDPRESS_DB_NAME=wordpress
ports:
- “8080:80”
external_links:
- env_postgres_db_1:posgtresql
volumes:
- ./wp-data:/var/www/html
- ./config/php.conf.ini:/usr/local/etc/php/conf.d/conf.ini

When i´m let’s go in my browser i see that error: Your PHP installation appears to be missing the PostgreSQL extension which is required by WordPress with PG4WP.

Can anybody help me? Please!

Thank´s!

Hi … again :slight_smile:

The issue is that the wordpress image does not include this php module, but have no fear! solution is here!

What you need to do, is to build your own image, from the wordpress one, that install this module.

Create a file called: Dockerfile

Add this into it:

FROM wordpress:latest
 
RUN apt-get update \
    && apt-get install -y libpq-dev \
    && docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
    && docker-php-ext-install pdo pdo_pgsql pgsql

Then run:

docker build -t myimage .

This will create your own image, with the name “myimage”, which will run the “recipe” above.
After the build is complete, you can change your compose file, so image: will be “myimage” instead of “wordpress”

I have not tested this 100%, other than seeing that the build worked, but i havnt tested it with the module.

But give it a go :slight_smile:

Hi Martin Terpz,
Thanks for your help! With your tips I solved the problem!