<?php
echo "=== CEK CURL ===\n\n";

if (function_exists('curl_version')) {
    echo "✅ CURL tersedia\n";
    $version = curl_version();
    echo "Versi: " . $version['version'] . "\n";
} else {
    echo "❌ CURL tidak tersedia! Aktifkan di php.ini\n";
}

echo "\nTest koneksi ke Telegram:\n";
$url = "https://api.telegram.org/bot8755174140:AAH0BpyLwAGohUea6h2-zeOB57BmSoPVcjY/getMe";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

$response = curl_exec($ch);
$error = curl_error($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP Code: " . $httpCode . "\n";
if ($error) {
    echo "Error: " . $error . "\n";
} else {
    echo "Response: " . substr($response, 0, 200) . "...\n";
}
?>