$value) { putenv("{$name}={$value}"); $loaded_vars[$name] = getenv($name); } // Verify loaded variables foreach ($required_vars as $var) { if (isset($loaded_vars[$var])) { $masked_value = substr($loaded_vars[$var], 0, 5) . '...'; $status = $loaded_vars[$var] === $zoho_vars[$var] ? '✅ Loaded correctly' : '❌ Loading failed'; echo " - {$var}: {$status} ({$masked_value})\n"; } else { echo " - {$var}: ❌ Not loaded\n"; } } echo "\n"; // Final assessment if (empty($missing_vars) && $test_var === 'This is a test') { echo "✅ Environment setup looks good! Zoho credentials should be loaded correctly.\n"; } else { echo "❌ Environment issues detected:\n"; if (!empty($missing_vars)) { echo " - Missing variables: " . implode(', ', $missing_vars) . "\n"; echo " - Please add these to your .env file\n"; } if ($test_var !== 'This is a test') { echo " - Environment loading isn't working correctly\n"; echo " - Check if PHP can access environment variables on your system\n"; } } // Test loading config file $config_file = __DIR__ . '/../wordpress/wp-content/plugins/hvac-community-events/includes/zoho/zoho-config.php'; echo "\nTesting Zoho config file loading:\n"; echo "Config file path: {$config_file}\n"; if (file_exists($config_file)) { echo "Config file: ✅ Found\n"; // Create a test script to include the config $test_script = <<