='),
"PHP Version: " . PHP_VERSION,
"PHP Version: " . PHP_VERSION . " (Requires 7.4+)");
// Extensions
check_status(extension_loaded('pdo_mysql'), "PDO MySQL extension is loaded.", "PDO MySQL extension is MISSING.");
check_status(extension_loaded('curl'), "CURL extension is loaded.", "CURL extension is MISSING (required for external link validation).");
// Config File
$has_config = file_exists('includes/config.php');
if (check_status($has_config, "Configuration file exists.", "Configuration file (includes/config.php) is MISSING.")) {
require_once 'includes/config.php';
// DB Connection
try {
$pdo = new PDO("mysql:host=".DB_HOST.";dbname=".DB_NAME, DB_USER, DB_PASS);
check_status(true, "Database connection established successfully.", "");
} catch (Exception $e) {
check_status(false, "", "Database connection failed: " . $e->getMessage());
}
}
// Write Permissions
check_status(is_writable('uploads'), "Uploads directory is writable.", "Uploads directory is NOT writable. Run: chmod 777 uploads");
// PHP Settings
$upload_max = ini_get('upload_max_filesize');
$post_max = ini_get('post_max_size');
$is_low = (int)$upload_max < 100 || (int)$post_max < 100;
if ($is_low) {
echo "
[WARN] Max Upload Size: $upload_max (Post Max: $post_max) - This is low for videos!
";
} else {
echo "
[PASS] Max Upload Size: $upload_max (Post Max: $post_max)
";
}
?>
Pro-Tips & Fixes:
MySQL Issues? Run: sudo systemctl status mysql. If stopped, run sudo systemctl start mysql.
Upload Limits? Edit /etc/php/7.4/apache2/php.ini. Look for upload_max_filesize and post_max_size. Set them to 500M or more, then run sudo systemctl restart apache2.
Permission Issues? Run: sudo chmod -R 777 uploads/ to ensure the web server can save video files.