Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker phpmyadmin ignoring my php.ini config

I build up a docker-compose environment with apache, php7.0, mysql and also added phpmyadmin.

I tried so many times to include my own php.ini file and finally, I got to php accept it as it shown in my index.php loaded with phpinfo().

I need to load a database that weights more than 750Mb and my phpmyadmin doesn't let me import databases larger than 512Mb.

I tried to compress the db to 60Mb, but when I try to import it, it takes so long and ends up cutting the import because it took so long, leaving my db incomplete.

Even setting up my php.ini file_size limits and all that, the phpmyadmin ignores it.

This is what I've changed in php.ini:

upload_max_filesize = 1024M
post_max_size = 1024M
memory_limit = 1024M
max_execution_time = 300

My docker-compose.yml is:

version: '3.3'

services:
  php:
    build: apache-php
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./apache-php/www:/var/www/html
    links:
      - mysql
      - phpmyadmin

  mysql:
    image: mysql:5.7
    volumes:
     - ./mysql:/var/lib/mysql
    environment:
     - MYSQL_ROOT_PASSWORD=1347891743
     - MYSQL_DATABASE=database

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    links:
      - mysql
    environment:
      PMA_HOST: mysql
      PMA_PORT: 3306
    ports:
      - "8080:80"
    volumes:
      - ./mysql:/var/lib/mysql

I also got a Dockerfile to run my php:

FROM php:7.0-apache

RUN docker-php-ext-install mysqli


COPY config/php.ini /usr/local/etc/php/

This is what it shows in phpmyadmin.

Phpmyadmin file size limit

A little of help would be very appreciated

like image 389
Luke Marks Avatar asked May 31 '18 09:05

Luke Marks


People also ask

Where is docker PHP INI file?

Unfortunately, PHP is looking for the default php. ini file at the default path. Files named ini-development or ini-production are not accepted. Other ini files can be loaded from a different location: /usr/local/etc/php/conf.

Where is PHP ini in phpMyAdmin?

Apache. On Apache, php. ini is usually located in /etc/php/8.1/apache2/php.

Can we use docker for PHP?

Using Docker with PHP (and more!) The DocuSign PHP code example launcher is configured to use Docker. Docker is containerization software that can help you package and deploy your applications in a consistent developer environment.


1 Answers

You can try:

Config of php.ini in phpmyadmin container in /usr/local/etc/php/

This is in .yml

phpmyadmin:
    volumes:
        - ./php-make/upload.ini:/usr/local/etc/php/php.ini

And file upload.ini

upload_max_filesize = 1280M
post_max_size = 1280M

Change any point if you want

I can do and success phpmyadmin

like image 98
Đàm Thanh Tuấn Avatar answered Oct 01 '22 02:10

Đàm Thanh Tuấn