Add mongodb extension to php image

I am trying to add a mongodb extension to the php image . I am getting the error as

WARNING: "pecl/mongo" is deprecated in favor of "channel:///mongodb"
pecl/mongo requires PHP (version >= 5.3.0, version <= 5.99.99), installed version is 7.1.16
No valid packages found
install failed
Exited with code 1

Please find the sample config file I am using

version: 2
jobs:
    build:
        docker:
            - {image: 'circleci/php:7.1.16'}
            #- {image: 'halplatform/hal-build-environments:php7.1-centos7'}
          
        steps:
            - checkout
            - {run: 'echo "A first hello"'}
            - {run: 'pwd'}
            - {run: 'ls'}
            - {run: 'php -v'}
            - {run: 'php --ini'}
            
            - {run: 'sudo apt-get install -y libzip-dev'}
            - {run: 'sudo docker-php-ext-install zip'}
            - {run: 'sudo apt-get install -y libpng-dev'}
            - {run: 'sudo docker-php-ext-install gd'}
            - {run: 'sudo pecl install mongo'}
           
            - {run: 'php --ini'}
           
workflows:
    version: 2
    Regression-tests:
        jobs:
            - build

(Would you fix your YAML formatting please? To do so, edit the question, select the whole of the YAML snippet, click the code button, then save. You may have to ensure there is a blank line above it, to ensure the Markdown formatting works. I might be able to advise after that has been done.

Same for the error block, but quote formatting is OK here too.)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.