Files
michaelschiemer/test_request_web.php
Michael Schiemer e30753ba0e fix: resolve RedisCache array offset error and improve discovery diagnostics
- Fix RedisCache driver to handle MGET failures gracefully with fallback
- Add comprehensive discovery context comparison debug tools
- Identify root cause: WEB context discovery missing 166 items vs CLI
- WEB context missing RequestFactory class entirely (52 vs 69 commands)
- Improved exception handling with detailed binding diagnostics
2025-09-12 20:05:18 +02:00

42 lines
1.2 KiB
PHP

<?php
require __DIR__ . '/vendor/autoload.php';
// Test if the issue is specifically in web context
// by accessing localhost directly
echo "Testing localhost web request...\n";
$context = [
'http' => [
'method' => 'GET',
'header' => [
'User-Agent: Mozilla/5.0 (compatible test)',
'Host: localhost'
],
'ignore_errors' => true
],
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false
]
];
$response = @file_get_contents('https://localhost/', false, stream_context_create($context));
if ($response === false) {
$error = error_get_last();
echo "Failed to fetch localhost: " . $error['message'] . "\n";
// Try HTTP instead
echo "Trying HTTP instead of HTTPS...\n";
$response = @file_get_contents('http://localhost/', false, stream_context_create($context));
if ($response === false) {
echo "HTTP also failed\n";
} else {
echo "HTTP response length: " . strlen($response) . "\n";
echo "Response snippet: " . substr($response, 0, 200) . "\n";
}
} else {
echo "Response length: " . strlen($response) . "\n";
echo "Response snippet: " . substr($response, 0, 200) . "\n";
}