When the configuration file is posted, the answer is obvious. The system has two PHP files.
php.ini-production
php.ini
I changed it to php.ini -_-!!!
- ./php-fpm/php.ini-production:/usr/local/etc/php/php.ini:ro
docker-compose restart
If the docker and php configuration files used change, use docker-compose rm and then docker-comose up. Why is there no change when looking at phpinfo()?
docker-compose.yml
# web server
nginx:
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
# app
- ./app/src:/usr/share/nginx/html
# nginx configs
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d/:/etc/nginx/conf.d/:ro
# certificates
#- ./nginx/ca/server.crt/:/etc/nginx/server.crt:ro
#- ./nginx/ca/server.key/:/etc/nginx/server.key:ro
links:
- fpm:__DOCKER_PHP_FPM__
# php-fpm
fpm:
build: ./php-fpm
ports:
- "9000"
volumes:
- ./app/src:/usr/share/nginx/html
# Your php.ini
- ./php-fpm/php.ini-production:/usr/local/etc/php/php.ini:ro
# environment:
# Set your APP env variables here:
# - APP_KEY=
# - DB_HOST=
# - DB_DATABASE=
# - DB_USERNAME=
# - DB_PASSWORD=
links:
- mysql:mysql
# database
mysql:
image: mysql:latest
ports:
# Allow client to access 3306
- "3306:3306"
volumes:
# NOTE: your data will be stored in ./mysql
- ./mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root123
The reasonable explanation is that the
php.ini
you modified is not the php.ini loaded by running PHP indocker
.Check which path is loaded in
php.ini
.docker rm will delete the modified configuration. You need to configure the local php.ini to map to docker in docker-compose.yml
Docker loads php in the image package, it is useless to modify the local one
php -i|grep php.ini to see if the loaded file is correct