title: How to load mysqli extension inside docker-compose.yml file with NGINX, PHP-FPM
body: <p>When loading docker-compose up, wordpress loads on the url but the mysqli_connect function is undefined because of the absence of the extension.  </p>
  
  <p>I have tried to add the following under the fpm image</p>
  
  <p>command: "docker-php-ext-install mysqli"</p>
  
  <p>I have tried to add a Dockerfile into the directory of the docker-compose.yml file containing </p>
  
  <pre><code>version: "3"
  
  services:
    #database
    db:
      image: mysql:5.7
      volumes:
        - db_data:/var/lib/mysql
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: wordpress
        MYSQL_DATABASE: wordpress
        MYSQL_USER: wordpress
        MYSQL_PASSWORD: wordpress
      networks:
        - wpsite
    # webserver
    nginx:
      image: nginx:latest
      ports:
        - "8080:80"
      links:
        - fpm
      volumes:
        - /Users/connergesbocker/Github/cbgesbocker/dotfiles/root/etc/nginx/conf.d/village.conf:/etc/nginx/conf.d/village.conf
        - /Users/connergesbocker/WordPress:/WordPress
      networks:
        - wpsite
    # phpmyadmin
    phpmyadmin:
      depends_on:
        - db
      image: phpmyadmin/phpmyadmin
      restart: always
      ports:
        - "8888:8888"
      environment:
        PMA_HOST: db
        MYSQL_ROOT_PASSWORD: wordpress
      networks:
        - wpsite
    fpm:
      image: php:5.6.20-fpm
      ports:
        - "90:9000"
      # command: "docker-php-ext-install mysqli"
      links:
        - db
      volumes:
        - /Users/connergesbocker/WordPress:/WordPress
      working_dir: "/"
      networks:
        - wpsite
  networks:
    wpsite:
  volumes:
    db_data:```
  </code></pre>