-
-
Save kovagoz/0d6a24405d974c06f77cd2533b63b3f8 to your computer and use it in GitHub Desktop.
FROM php:5.6-fpm-alpine | |
RUN apk update && apk add autoconf openssl-dev g++ make && \ | |
pecl install mongo && \ | |
docker-php-ext-enable mongo && \ | |
apk del --purge autoconf openssl-dev g++ make |
Thanks! That was exactly what I needed. I just changed the extension name to mongodb
as I'm using it with php 7, and it works just fine.
Thanks! That was exactly what I needed. I just changed the extension name to
mongodb
as I'm using it with php 7, and it works just fine.
In php 7.2 with fpm and alpine I need add libssl1.0 for found. I have this code example with my correction
@Fiser12 Your link doesn't seem to be right. 😅
thank you @kovagoz
I run the same code but got this error.
pecl/mongodb requires PHP (version >= 7.2.0, version <= 8.99.99), installed version is 5.6.40
can you help me solve this?
@babininja If you use php 5.6. you should install the mongo
extension. Exactly as in this example. The mongodb
extension should be used only if you're on PHP >= 7.2. To switch to higher version of PHP change the first line of this Dockerfile to something like FROM php:8.1-fpm-alpine
(use your desired version of PHP)
@mtrojanowski I am using php5.6-mongodb without docker and it works. but when i try to add it to docker file i can't. if i use php-mongo it gives me this error 'Class 'MongoDB\Driver\Manager' not found'.
Thanks so much!, after trying 10+ other combinations this was the the first one that actually compiled properly on Alpine.