Troubleshooting docker-php-ext-enable: 108: docker-php-ext-enable: cannot create /conf.d/XXXXXX.ini: Directory nonexistent

A recent change in the way the config location of modules is decided in the upstream PHP images can result in the error message in the title.

The config location is decided by the environment variable "PHP_INI_DIR", which is set as part of the image's environment.

If using sudo to enable config, the necessary environment variable is stripped before the command is run, resulting in the config going to the wrong place.

Solution

To get things to work as they did before, you can add the -E flag to the sudo command to have it preserve the environment.

Old config:

sudo docker-php-ext-install mcrypt 

New config:

sudo -E docker-php-ext-install mcrypt
Was this article helpful?
8 out of 10 found this helpful

Comments

0 comments

Article is closed for comments.