Where is php.ini being loaded on this instance of Docker?

1

I'm running an instance that comes from this Dockerfile .

Here I have part of my phpinfo:

AswecanseeConfigurationFile(php.ini)Pathispointingto/usr/local/etc/php.Thisvaluewaspassedinline31ofDockerfileENVPHP_INI_DIR/usr/local/etc/php.

Butinsidemysubfilesof/usr/local/etc/Icannotfindanyphp.ini:

AswecanseeinphpinfotheLoadedConfigurationFileisempty.

Idonotknowwherethesettingsonthispagearecomingfrom.Whereisphp.inibeingloaded?

Ialsodonotseethephpservicetotrytorestartit:

UPDATE:Ihavephp.iniinthisfolder:

Here'stheDockerfile:

FROMphp:5-apache#Updateapt-getRUNapt-getupdate##listofinstalledlibrarypackagesonly=>https://askubuntu.com/questions/434154/how-to-get-the-list-of-installed-library-packages-only#ldconfig-v#-vitwillshowthelibrariesversions#ldconfig-v|greplibname#Usegreptofindaspecificlibrarybyname.#RUN/sbin/ldconfig-p##ListInstalledPackages=>https://wiki.debian.org/ListInstalledPackages#RUNdpkg-query-l##NOTE:##needsetupphpvariablesdateandmaxuploadfileandothersvariables.==>https://howto.biapy.com/en/debian-gnu-linux/servers/php/manage-php-ini-options-from-command-line-on-debian##InstallFFmpegonDebian=>https://superuser.com/questions/286675/how-to-install-ffmpeg-on-debian#https://www.johnvansickle.com/ffmpeg/##Systemmodules#RUNapt-getinstalldeb-multimedia-keyring#RUNapt-getupdate#RUNapt-getinstall-yffmpeg##UTILITIESRUNapt-getinstall-yvim#RUNapt-getinstall-ywget##APACHE2basicinstallationRUNapachectl-MRUNa2enmodrewriteRUNa2enmodexpiresRUNserviceapache2restartRUNapachectl-M##################################################PHPmodules##Note:wheninstallingfromphp5forsomemodulesweneedtocopyfromphp5/mods-availabletolocal/etc/php/conf.dandcreateasimboliclinkRUNphp-mRUNapt-getinstall-yphp5-commonRUNapt-getinstall-yphp-calendar#RUNcp/etc/php5/mods-available/calendar.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/calendar.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/calendar.so#RUNdocker-php-ext-installcalendarRUNdocker-php-ext-installbcmathRUNapt-getinstall-yphp5-mhash#RUNcp/etc/php5/mods-available/mhash.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/mhash.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/mhash.soRUNapt-getinstall-yphp5-intlRUNcp/etc/php5/mods-available/intl.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/intl.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/intl.soRUNapt-getinstall-yphp5-mcryptRUNcp/etc/php5/mods-available/mcrypt.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/mcrypt.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/mcrypt.soRUNapt-getinstall-yphp5-redisRUNcp/etc/php5/mods-available/redis.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/redis.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/redis.soRUNapt-getinstall-yphp5-mysqlRUNcp/etc/php5/mods-available/mysql.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/mysql.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/mysql.soRUNcp/etc/php5/mods-available/opcache.ini/usr/local/etc/php/conf.dRUNapt-getinstall-yphp5-gdRUNcp/etc/php5/mods-available/gd.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/gd.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/gd.soRUNapt-getinstall-yphp5-gdcmRUNcp/etc/php5/mods-available/gdcm.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/gdcm.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/gdcm.soRUNapt-getinstall-yphp5-vtkgdcmRUNcp/etc/php5/mods-available/vtkgdcm.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/vtkgdcm.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/vtkgdcm.soRUNapt-getinstall-yphp5-ldapRUNcp/etc/php5/mods-available/ldap.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/ldap.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/ldap.soRUNapt-getinstall-yphp5-xslRUNcp/etc/php5/mods-available/xsl.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/xsl.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xsl.soRUNapt-getinstall-yphp5-tidyRUNcp/etc/php5/mods-available/tidy.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/tidy.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/tidy.soRUNapt-getinstall-yphp5-xmlrpcRUNcp/etc/php5/mods-available/xmlrpc.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/xmlrpc.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xmlrpc.soRUNapt-getinstall-yphp5-pgsqlRUNcp/etc/php5/mods-available/pgsql.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/pgsql.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/pgsql.soRUNcp/etc/php5/mods-available/mysqli.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/mysqli.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/mysqli.soRUNcp/etc/php5/mods-available/pdo.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/pdo.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/pdo.soRUNcp/etc/php5/mods-available/pdo_mysql.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/pdo_mysql.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/pdo_mysql.soRUNcp/etc/php5/mods-available/pdo_pgsql.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/pdo_pgsql.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/pdo_pgsql.soRUNcp/etc/php5/mods-available/readline.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/readline.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/readline.so#RUNapt-getinstall-yphp5-snmp#RUNcp/etc/php5/mods-available/snmp.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/snmp.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/snmp.soRUNphp-m##REDISRUNapt-getinstall-ytelnetredis-serverRUNapt-getinstall-yredis-serverRUNapt-getinstall-ynpm#RUNmkdir/composer-setup&&mkdir/usr/local/bin/composer&&wgethttps://getcomposer.org/installer-P/composer-setup&&php/composer-setup/installer--install-dir=/usr/local/bin/composer&&rm-Rf/composer-setup##################################################PHPextramodules#RUNapt-getinstall-yphp-horde-date-parser##Thecommand'/bin/sh-capt-getinstall-yphp-horde-date-parser'returnedanon-zerocode:100#RUNapt-getinstall-yphp-horde-date#RUNapt-getinstall-yphp-horde-timezone#RUNapt-getinstall-yphp-horde-timeobjects#RUNapt-getinstall-yphp-timer#RUNapt-getinstall-yphp-horde-icalendar#RUNapt-getinstall-yphp-horde-kronolith#RUNapt-getinstall-yphp-doctrine-dbal#RUNapt-getinstall-yphpldapadmin#RUNapt-getinstall-yphp-horde-ldap#RUNapt-getinstall-yphp-net-ldap#RUNapt-getinstall-yphp-net-ldap2#RUNapt-getinstall-yphp-mdb2-driver-pgsql#RUNapt-getinstall-ylibnusoap-php#RUNapt-getinstall-yphp-soap#RUNapt-getinstall-yphp-fxsl#RUNapt-getinstall-yphp-horde-text-filter-csstidy#RUNapt-getinstall-yphp-pclzip#RUNapt-getinstall-ylibphp-pclzip#RUNapt-getupdate#RUNcp/etc/php5/mods-available/json.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/json.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/json.so#ManagePHPinioptionsfromcommandlineonDebian=>https://howto.biapy.com/en/debian-gnu-linux/servers/php/manage-php-ini-options-from-command-line-on-debian#RUNapt-getinstall-yphp5-cli###Note:Comparecontent#PHP5#cd/usr/local/etc/php/conf.d#cd/etc/php5/mods-available/#PHP#cd/usr/local/lib/php/extensions/no-debug-non-zts-20131226#cd/usr/lib/php5/20131226/##Note:whenmoduleisphp5needtomakeitavailableinsidephp/extensions(createasimboliclink)#RUNcp/etc/php5/mods-available/MODULE.ini/usr/local/etc/php/conf.d&&ln-s/usr/lib/php5/20131226/MODULE.so/usr/local/lib/php/extensions/no-debug-non-zts-20131226/MODULE.so##################################################WORKDIR#COPYmanyvids//var/www/html#COPYsrc//var/www/html#CONNECTIONS-PORTS#EXPOSE80#########################################.Extranotes#CMD["redis-server"]

## Clean up Docker
#docker rm $(docker ps -a)
#docker rmi $(docker images)
#docker build -t mv1_img . 

## RUN REDIS 
#Open up another terminal
#docker  exec -it  xxxxxCOntainerId bash 
#root@bxxxxxCOntainerId:/var/www/html# redis-server

#If another terminal is needed to get acces to the container:
#Open up another terminal
#docker  exec -it  xxxxxCOntainerId bash 


## Not found modules. We have it in MAMP instance, not in DOCKER apt php list and not in php -m
#mysqli
#pdo_mysql
#pdo_pgsql
#shmop
#sockets
#sysvmsg
#sysvsem
#sysvshm
#wddx
    
asked by anonymous 14.11.2017 / 16:11

2 answers

0

You can validate the get of php with the installation cycle of line 108 to 151 of dockerfile.

You have to check if the sapi was installed, maybe it was missing because I did not see in the wget file or apt-get it, where you could use fpm.

If you have any problems uploading the app will send us the comments.

    
14.11.2017 / 18:48
0

See the example of how PHP.ini should load in the Docker PHP library itself:

FROM php:7.2-fpm-alpine

# Use the default production configuration
RUN mv $PHP_INI_DIR/php.ini-production $PHP_INI_DIR/php.ini

# Override with custom opcache settings
COPY config/opcache.ini $PHP_INI_DIR/conf.d/

In this example the author chose to use the production configuration, so he renamed the php.ini-production file to php.ini. So in your case if there is the file /usr/local/etc/php/php.ini this will be where PHP will get the configuration. And the /usr/local/etc/php/conf.d/ folder is for the extensions settings, as in the example above, opcache's own configuration is used.

If you want to use your own configuration, just copy it from your directory to the PHP configuration folder. Example:

COPY config/php.ini $PHP_INI_DIR/php.ini

Follow the documentation link: doc

    
26.10.2018 / 14:51