Getting Class "mysqli" not found when using docker container to load mysql and php
one text
First time working with creating a docker container, i am trying to add a mysql container which seems to be added fine according to the command line however in the browser i get error class mysqli not found
I have added a docker file which includes the following Dockerfile
FROM php:8.0-apache
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
RUN apt-get update && apt-get upgrade -y
docker-compose.yml
version: '3.6'
services:
php-apache-environment:
container_name: php-apache
image: php:8.0-apache
volumes:
- ./php/src:/var/www/html/
ports:
- 8000:80
db:
container_name: db
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD
MYSQL_DATABASE: MY_DATABASE
MYSQL_USER: MYSQL_USER
MYSQL_PASSWORD: MYSQL_PASSWORD
ports:
- "9906:3306"
I have also ran docker compose up However i am still getting error class mysqli not found
Source