connect_error) { // retrieving admin entry $sql = "SELECT id, name FROM admins"; $result = $conn->query($sql); if ($result) { $installed = true; } } $conn->close(); } else { $installed = true; } } if (!$installed) { // including classes include __DIR__ . '/Classes/Permission.php'; include __DIR__ . '/Classes/Requirement.php'; include __DIR__ . '/Classes/Welcome.php'; // including php files include __DIR__ . '/Environment.php'; include __DIR__ . '/Migration.php'; include __DIR__ . '/Admin.php'; include __DIR__ . '/Finish.php'; // including js include __DIR__ . '/JS/script'; // object creation $requirement = new Requirement(); $permission = new Permission(); $welcome = new Welcome(); // calling render function for template echo $requirement->render(); echo $permission->render(); echo $welcome->render(); $storage_output = exec('cd ../.. && php artisan storage:link 2>&1'); } else { // getting url $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = explode("/", $actual_link); array_pop($url); array_pop($url); $url = implode("/", $url); $url = $url . '/404'; // redirecting to 404 error page header("Location: $url"); } ?>