Where is the php configuration file pulled by docker

due to a 502 error in the configuration of connecting to nginx, I want to modify the configuration listen = 127.0.0.1 br 9000
to listen = 0.0.0.0 listen 9000.
php in docker pull php is the latest version. If you can"t find the configuration file in the container, you can map it and modify it if you find it. Ask for the answer of the Great God

Apr.03,2021

if you ask this kind of question, you must not have learned how to learn new tools. In a very simple sentence, all questions that you don't understand are given priority in finding official documents . Similarly, the official image documents of Dokcer are very complete. The following is the address of php official image documents:

https://hub.docker.com/r/arm64v8/php/

the answer you want is as follows:

We recommend that you add a custom php.ini configuration. COPY it into / usr/local/etc/php by adding one more line to the Dockerfile above and running the same commands to build and run:

FROM arm64v8/php:7.0-apache
COPY config/php.ini /usr/local/etc/php/
COPY src/ /var/www/html/

Where src/ is the directory containing all your PHP code and config/ contains your php.ini file.


in fact, the official document does not specify where the configuration file is, but just says which directory the php.ini should be placed in.

but you can find it yourself with the find /-name php command.

all the configuration files except php.ini are in / usr/local/etc

.

php.ini needs to add it yourself

in fact, lz can use find /-name php to find the corresponding file

you can also look up the official website document in the php image in docker hub.

the configuration file for php is shown in the figure

/usr/local/etc  
|-- log
|   `-- php-fpm
|       `-- xdebug.log
|-- pear.conf
|-- php
|   |-- conf.d
|   |   |-- docker-php-ext-gd.ini
|   |   |-- docker-php-ext-mysqli.ini
|   |   |-- docker-php-ext-opcache.ini
|   |   |-- docker-php-ext-pdo_mysql.ini
|   |   |-- docker-php-ext-redis.ini
|   |   |-- docker-php-ext-sodium.ini
|   |   |-- docker-php-ext-xdebug.ini
|   |   |-- docker-php-ext-yaf.ini
|   |   `-- docker-php-ext-zip.ini
|   `-- php.ini
|-- php-fpm.conf
|-- php-fpm.conf.default
`-- php-fpm.d
    |-- docker.conf
    |-- www.conf
    |-- www.conf.default
    `-- zz-docker.conf

such a directory structure should be fine.

< hr >

to add, you can also look up

in this way.

php-I | grep php.ini


if docker containers are connected to each other, you should use-- link

  

problem solved

Menu