I just pulled docker image php:5-apache and it runs well and all but there is no /etc/php5/apache2/php.ini file so I can't add extension=mongodb.so even if it is installed with PECL.


You can see what directories php looks for ini files in with the --ini flag. Here is an example on the php:5-apache image:

root@2ca6abaef312:/var/www/html# php --ini
Configuration File (php.ini) Path: /usr/local/etc/php
Loaded Configuration File:         (none)
Scan for additional .ini files in: /usr/local/etc/php/conf.d
Additional .ini files parsed:      (none)

You can create an ini file in /usr/local/etc/php/conf.d with the changes you require.

  • Thanks, I added a php.ini file with just one line and it works. – Tomasz Jan 29 '16 at 20:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.