I am trying to compile Mongodb module statically into PHP.
I have successfully compiled PHP (without Mongodb module) using the instructions here: https://aws.amazon.com/blogs/compute/scripting-languages-for-aws-lambda-running-php-ruby-and-go/
Then I compile Mongodb driver using the instructions here: http://php.net/manual/en/mongodb.installation.manual.php. The module mongodb.so is generated and stored successfully in the PHP source files.
But in order to re-compile PHP to bundle the Mongodb module, I tried the following instructions http://php.net/manual/en/install.pecl.static.php, but I don't know which flag I need to use to compile PHP with the Mongodb module.
I have tried --with-mongodb, --with-mongo, --enable-mongodb and --enable-mongo but none of those are valid flags.
Could somebody be so kind to help me out with this problem?
Many thanks in advance.
After spend lot of time on this, I finally can compile PHP with mongodb extension statically installed. I realized that the version of extension I was trying was not supported to accomplish this.
RUN git clone https://github.com/mongodb/mongo-php-driver.git mongodb && \
cd mongodb && \
git checkout 1.5.3 && git submodule update --init && \
cd ../ && mv mongodb ext/mongodb
RUN ./buildconf --force
RUN ./configure \
...
--enable-mongodb \
...
RUN make -j 5 && make install
When checkout the extension to tag 1.5.3
I could add the ---enable-mongodb
flag on the /configure
command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With