skip to Main Content

I can’t download any php extensions inside my docker container, when trying
yum install php7.3-mysql it gives me error

“No package php7.3-zip available.”

And when trying with docker-php-ext-install it gives me

“bash: docker-php-ext-install: command not found”

The docker container was created from the centos official image, just pulled it and installed php7.3 successfully but not the extensions

2

Answers


  1. In CentOS 7.6 you have to enable the Epel-Repository first to get the version.

    yum install epel-release
    

    Then you can install the Remi-Repository to get the latest PHP-Version.

    yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    yum-config-manager --enable remi-php73
    

    Then you can install the latest PHP-Version with:

    yum install php
    

    In CentOS normally there are older versions and you have to install them first.

    Login or Signup to reply.
  2. Replayed your issue following the steps below:

    docker run --rm -it centos:7 /bin/bash
    echo "nameserver 8.8.8.8" >> /etc/resolv.conf
    yum install -y epel-release
    yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
    yum install -y php7.3-mysql
    

    And for the last operation I got:

    Loaded plugins: fastestmirror, ovl
    Loading mirror speeds from cached hostfile
    epel/x86_64/metalink                                                                                                                                                                                                   
    |  27 kB  00:00:00     
     * base: distrib-coffee.ipsl.jussieu.fr
     * epel: mirror.infonline.de
     * extras: mirror.plusserver.com
     * remi-safe: remi.mirrors.cu.be
     * updates: distrib-coffee.ipsl.jussieu.fr
    epel                                                                                                                                                                                                                   
    | 5.4 kB  00:00:00     
    remi-safe                                                                                                                                                                                                              
    | 3.0 kB  00:00:00     
    (1/4): epel/x86_64/group_gz                                                                                                                                                                                            
    |  90 kB  00:00:00     
    (2/4): epel/x86_64/updateinfo                                                                                                                                                                                          
    | 1.0 MB  00:00:00     
    (3/4): epel/x86_64/primary_db                                                                                                                                                                                          
    | 6.9 MB  00:00:06     
    (4/4): remi-safe/primary_db                                                                                                                                                                                            
    | 1.6 MB  00:00:06     
    No package php7.3-mysql available.
    Error: Nothing to do
    

    The package name you have specified does not exist, however it exists php73-php-mysqlnd, that looks pretty close to what you are trying to get.

    yum search php73-php-mysqlnd
    php73-php-mysqlnd.x86_64 : A module for PHP applications that use MySQL
    

    Try with this:

    yum install -y php73-php-mysqlnd
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search