test message for postgis connect

This commit is contained in:
luptmoor
2026-04-15 09:20:17 +02:00
parent 0d0331a846
commit 3410b9ad41

View File

@@ -1,21 +1,23 @@
<?php <?php
/** $host = 'webgis-db'; // Matches the service name in docker-compose
* WebGIS Connectivity Test $db = 'webgis-db';
*/ $user = 'webgis-db-admin';
$pass = 'endex-webgis';
echo "<h1>🌍 WebGIS Subdomain is Live!</h1>"; try {
echo "<p><strong>Current Server:</strong> " . $_SERVER['SERVER_NAME'] . "</p>"; $dsn = "pgsql:host=$host;port=5432;dbname=$db;";
echo "<p><strong>PHP Version:</strong> " . phpversion() . "</p>"; $pdo = new PDO($dsn, $user, $pass, [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);
// Check for common GIS extensions (optional but helpful) if ($pdo) {
$extensions = ['gd', 'intl', 'bcmath', 'pdo_pgsql']; echo "<h1>✅ Connected to PostGIS!</h1>";
echo "<h3>GIS Extension Check:</h3><ul>";
foreach ($extensions as $ext) { // Check PostGIS version
$status = extension_loaded($ext) ? "✅ Loaded" : "❌ Not Found"; $query = $pdo->query("SELECT PostGIS_full_version();");
echo "<li>$ext: $status</li>"; $version = $query->fetch();
echo "<p><strong>PostGIS Version:</strong> " . $version[0] . "</p>";
}
} catch (PDOException $e) {
echo "<h1>❌ Connection Failed</h1>";
echo "<p>" . $e->getMessage() . "</p>";
} }
echo "</ul>"; ?>
echo "<hr>";
echo "<p>If you see this, your Nginx → PHP-FPM bridge is working perfectly over HTTPS.</p>";
?>