From 3d608e6508494848856956e9ad3b2d78bda57667 Mon Sep 17 00:00:00 2001 From: MAGHFIRA IZZATI Date: Wed, 10 Jun 2026 17:11:23 +0700 Subject: [PATCH] fix: update db_config env vars and Dockerfile --- Dockerfile | 4 ++-- WEBGIS/01/api/db_config.php | 6 +++--- webtugas/01/api/db_config.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 325cb7b..0909a36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM php:8.2-apache -# Install ekstensi mysqli untuk koneksi ke database -RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli +# Install ekstensi mysqli dan pdo_mysql untuk koneksi ke database +RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable mysqli # Aktifkan mod_rewrite Apache (berguna untuk URL yang bersih/routing) RUN a2enmod rewrite diff --git a/WEBGIS/01/api/db_config.php b/WEBGIS/01/api/db_config.php index e456107..0b341ab 100644 --- a/WEBGIS/01/api/db_config.php +++ b/WEBGIS/01/api/db_config.php @@ -2,9 +2,9 @@ mysqli_report(MYSQLI_REPORT_OFF); $host = getenv("DB_HOST") ?: "localhost"; -$user = "root"; -$pass = "fira123"; -$db = "webgis"; // Menggunakan database sendiri sesuai setup_webgis.sql +$user = getenv("DB_USER") ?: "root"; +$pass = getenv("DB_PASS") ?: "fira123"; +$db = getenv("DB_NAME") ?: "webgis"; $conn = new mysqli($host, $user, $pass, $db); diff --git a/webtugas/01/api/db_config.php b/webtugas/01/api/db_config.php index 134b888..95d621b 100644 --- a/webtugas/01/api/db_config.php +++ b/webtugas/01/api/db_config.php @@ -2,9 +2,9 @@ mysqli_report(MYSQLI_REPORT_OFF); $host = getenv("DB_HOST") ?: "localhost"; -$user = "root"; -$pass = "fira123"; -$db = "kemiskinan_ibadah"; +$user = getenv("DB_USER") ?: "root"; +$pass = getenv("DB_PASS") ?: "fira123"; +$db = getenv("DB_NAME2") ?: "kemiskinan_ibadah"; $conn = new mysqli($host, $user, $pass, $db);