Created
September 2, 2016 05:03
-
-
Save kovagoz/0d6a24405d974c06f77cd2533b63b3f8 to your computer and use it in GitHub Desktop.
Alpine Linux with PHP 5.6 FPM and Mongo module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
@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'.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?