Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Docker install php7-mysql

For a while now, I'm trying to install the php7-mysql driver into different PHP docker containers from php/docker with no luck.

My Dockerfile looks like this:

# Dockerfile
FROM php:7.3-rc-apache-stretch
RUN apt-get update && apt-get upgrade -y

When I attach to the container and try to run

apt-get install php7.0-mysql

Debian stretch says that it has no installation candidate.

E: Package 'php7.0-mysql' has no installation candidate

What can I do to be able to install php7.0 modules to Debian Stretch?

Thanks in advance, this really took me some pomodores now!

like image 794
divramod Avatar asked Oct 20 '25 09:10

divramod


1 Answers

It appears you are missing the repository for php7.

  • Adding the php7 ppa:

    sudo add-apt-repository ppa:ondrej/php

  • Then update:

    sudo apt-get update

  • Now do a search to confirm php7 is there:

    sudo apt search php7

  • Now install the php7 package:

    sudo apt install php7.0-mysql

like image 86
Manish Chauhan Avatar answered Oct 21 '25 22:10

Manish Chauhan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!