When I try to install MongoDB with composer, it complains that I don't have the mongodb extension configured in my ini files. It's looking at the regular php ini files but mine are under /fpm
as I'm using nginx. How can I tell composer to use the FPM version of PHP?
Asked
Active
Viewed 974 times
-1

Jasper van den Bosch
- 3,169
- 4
- 32
- 55
-
Composer is a command-line application. It doesn't use your web server. – Álvaro González Dec 07 '18 at 17:52
-
so composer is only for the development environment? – Jasper van den Bosch Dec 07 '18 at 17:56
-
Would this be a sensible solution: http://paulwhippconsulting.com/blog/getting-php-cli-to-match-php5-fpm-so-it-behaves-consistently-under-nginx/ – Jasper van den Bosch Dec 07 '18 at 17:57
1 Answers
0
I found two solutions:
(after I figured out that composer uses the php-cli
configuration)
- Link the
php-fpm
configuration into thephp-cli
configuration, as detailed in:
This seems more elegant, but doesn't seem to be official so it may break.
- Copy all your configuration directives (.ini files) to both the
php-cli
and thephp-fpm
configuration directories.
The downside of this ofcourse is that if not done carefully, your production and development environment end up having different configuration settings.

Jasper van den Bosch
- 3,169
- 4
- 32
- 55