I've been stuck on this problem for the last four hours and I've tried everything I could find on stackoverflow but nothing seems to work.
when visiting the appache server in my container I get greeted with an error: driver not found

I supsect this is an issue with PDO since the tut I followed used sqlite
In my Dockerfile i did add the PDO extension but to no result?
This is my docker-compose.yml
services:
php-apache-environment:
container_name: php-apache
build:
context: .
dockerfile: Dockerfile
depends_on:
- db
volumes:
- ./src:/var/www/html/
ports:
- 8000:80
db:
container_name: db
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: bitchan
MYSQL_USER: bit_academy
MYSQL_PASSWORD: bit_academy
ports:
- "9906:3306"
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- '8080:80'
restart: always
environment:
PMA_HOST: db
depends_on:
- db
and this is my Dockerfile
FROM php:8.0-apache
RUN apt-get update && apt-get upgrade -y
RUN docker-php-ext-install pdo pdo_mysql && docker-php-ext-enable pdo pdo_mysql
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli
How I connect to the DB on my index.php:
$conn = (require "./db/connectdb.php")();
try {
$stmt = $conn->prepare("SELECT * FROM boards");
$stmt->execute();
$boards = $stmt->fetchAll();
$stmt = $conn->prepare("SELECT posts.*, b.board_name, b.shorthand FROM posts JOIN boards b on b.id = posts.board_id ORDER BY modified_at DESC LIMIT 5;");
$stmt->execute();
$posts = $stmt->fetchAll();
} catch (PDOException $e) {
echo $e->getMessage();
}
and lastely my connectdb.php:
<?php
return function () {
$servername = "db:3306";
$username = "bit_academy";
$password = "bit_academy";
try {
$conn = new PDO("mysql:host=$servername;dbname=bitchan", $username, $password);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo $e->getMessage();
}
return $conn;
}
?>
Also my project dir:

If anyone knows what I'm doing wrong you'd make my day! thanks in advance!