0

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

t2149573
  • 335
  • 1
  • 3
  • 10
  • 1
    You need to provide a [mcve], your question is off-topic without it. As a new user, also take the [tour] and read [ask]. – Ulrich Eckhardt Sep 08 '19 at 14:18
  • I edited the question, should be easy to reproduce now – t2149573 Sep 08 '19 at 14:53
  • You could provide the exact reproduction recipe using a dockerfile. At the moment, it still requires interpretation. – Ulrich Eckhardt Sep 08 '19 at 20:47
  • Could you provide your Dockerfile? Without it, we can not replay the scenario. –  Sep 08 '19 at 23:06
  • I didn't use any dockerfiles, I pulled the image , created a container with run command , attached to it , ran yum update , then yum install epel-release , then yum install php7.3 , all with success, then tried to install php7.3-mysql in 2 different ways as above didn't work. That's literally it, I swear – t2149573 Sep 12 '19 at 09:56

2 Answers2

0

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.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
0

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
  • I had to use the official php image which is Debian based, but I tried this now on a centos image and it actually worked perfectly. Thanks – t2149573 Nov 11 '19 at 10:33
  • Simply follow the Wizard instructions... https://rpms.remirepo.net/wizard/ – Remi Collet Nov 11 '19 at 12:48