Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WordPress 5 dropin for db-error.php, a custom error message in case of a failed database connection
<?php ob_start();
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-After: 3600');
mail("info@ihredomain", "Datenbankfehler", "Schon wieder die Datenbank!", "From: Meine Website");
?><!DOCTYPE html>
<meta charset="UTF-8">
<title>Website nicht erreichbar</title>
<h1>Die Website ist leider gerade nicht erreichbar.</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment