I'm attempting to setup a docker container to run expression engine. Using best practices for Docker, it is recommended to separate the db from the web host and php containers. However, it seems there is no easy way to specify a remote database that I can find. The admin.php wizard always fails to connect to the database.

  • I am using mysql 5.6 currently
  • I have a hostname (db) that connects to the SQL container correctly via telnet from php and web containers, so I know its available.
  • Setting the server address to db or its ip address fails to connect
  • I have even tried a stream rewrite in nginx to pass all data from localhost:3306 to db:3306 with no luck. Tested by telnetting to localhost:3306 from php and web containers.

Does anyone have the correct procedure to tweak the database hostname before running the wizard with admin.php?


2 Answers 2


Figured it out.

FROM php:fpm-alpine

Doesn't include the mysql mods. I had to add this line to my dockerfile for php container:

RUN docker-php-ext-install mysqli pdo pdo_mysql
  • Thanks for the information.
    – Stéphane
    May 9, 2020 at 3:40

Managed Cloud Hosting Platform Focus on your business and avoid all the web hosting hassles. Our managed hosting guarantees unmatched performance, reliability and choice with 24/7 support that acts as your extended team, making Cloudways an ultimate choice for growing agencies and ecommerce businesses. this is the link https://www.cloudways.com/en/?id=859025

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.