HEX
Server: nginx/1.18.0
System: Linux mail.dakarash.co.id 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: www-data (33)
PHP: 8.1.2-1ubuntu2.23
Disabled: NONE
Upload Files
File: /home/dakarash.co.id/public_html/.wpdbdiag.php
<?php
header('Content-Type: text/plain; charset=UTF-8');

// 1) Cek modul
echo 'ext.mysqli='.(int)extension_loaded('mysqli').' ext.pdo_mysql='.(int)extension_loaded('pdo_mysql')."\n";

// 2) Baca wp-config.php tanpa mengeksekusi WordPress
$cfg = __DIR__ . '/wp-config.php';
if (!is_readable($cfg)) { echo "ERR: wp-config.php not found or unreadable\n"; exit; }
$txt = file_get_contents($cfg);

// Ambil konstanta dengan regex
function getdef($name, $txt) {
  if (preg_match("/define\\(\\s*'".preg_quote($name,"/")."'\\s*,\\s*'([^']*)'\\s*\\)\\s*;/", $txt, $m)) return $m[1];
  if (preg_match('/define\\(\\s*"'.preg_quote($name,"/").'"\\s*,\\s*"([^"]*)"\\s*\\)\\s*;/', $txt, $m)) return $m[1];
  return null;
}
$dbn = getdef('DB_NAME', $txt);
$dbu = getdef('DB_USER', $txt);
$dbp = getdef('DB_PASSWORD', $txt);
$dbh = getdef('DB_HOST', $txt);

echo "DB_NAME=".($dbn??'(null)')." DB_USER=".($dbu??'(null)')." DB_HOST=".($dbh??'(null)')."\n";

// 3) Jika mysqli tak ada, berhenti (ini penyebab umum error WP)
if (!extension_loaded('mysqli')) { echo "FATAL: mysqli extension not loaded\n"; exit; }

// 4) Tes koneksi
$lnk = @mysqli_connect($dbh ?: 'localhost', $dbu ?: '', $dbp ?: '', $dbn ?: '');
if (!$lnk) { echo "CONNECT_ERR: ".mysqli_connect_error()."\n"; exit; }
$res = mysqli_query($lnk, 'SELECT DATABASE() db, VERSION() ver');
$row = $res ? mysqli_fetch_assoc($res) : [];
echo "OK DB=".(@$row['db'])." MySQL=".(@$row['ver'])."\n";
mysqli_close($lnk);