I got the problem with my Docker Compose. I set up a local development for a old project which using symfony 1.4, PHP 5.5 and Mysql 5.7.30
Everything goes fine until I run the app in browser. Nothing show up and I check the log file. It said:
[error] 6#6: *5 FastCGI sent in stderr: "PHP message: [wrapped: mysql extension not loaded [User Info: Array]]" while reading upstream, client: 118.70.126.249, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://172.22.0.3:9000"
I also enabled the extension in the php.ini file, but it didn't work.
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=pdo_mysql
;extension=php_pdo_mysql.dll
;extension=pdo_mysql.so
This is my screenshot for checking phpinfo()

This is my docker-compose.yml
version: '3'
services:
nginx:
image: nginx:1.11.4
container_name: nginx
ports:
- 8091:80
volumes:
- ./app:/var/www/html
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./nginx/log/:/var/log/nginx/
depends_on:
- php
- mysql
php:
build:
context: .
dockerfile: Dockerfile
container_name: php
ports:
- 9000:9000
working_dir: /var/www/html
volumes:
- ./app:/var/www/html
- ./php/php.ini:/usr/local/etc/php/php.ini
depends_on:
- mysql
mysql:
image: mysql:5.7.30
container_name: mysql
ports:
- 3307:3306
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_USER=admin
- MYSQL_DATABASE=symfony_db
- MYSQL_PASSWORD=secret
And this is Dockerfile
FROM php:5.5-fpm
WORKDIR /var/www/html
RUN apt-get update && apt-get install -y \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl
RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
RUN docker-php-ext-install gd
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Add user for laravel application
RUN groupadd -g 1000 www
RUN useradd -u 1000 -ms /bin/bash -g www www
# Copy existing application directory permissions
COPY --chown=www:www . /var/www
# Change current user to www
USER www
EXPOSE 9000
CMD ["php-fpm"]
Any help are appreciated! Thank you guys!