42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
/**
|
|
* Debug API для диагностики проблем
|
|
*/
|
|
|
|
// Включаем отображение всех ошибок
|
|
error_reporting(E_ALL);
|
|
ini_set('display_errors', 1);
|
|
|
|
// Устанавливаем заголовки
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
try {
|
|
echo json_encode([
|
|
'success' => true,
|
|
'debug' => [
|
|
'get_params' => $_GET,
|
|
'post_params' => $_POST,
|
|
'server' => $_SERVER,
|
|
'php_version' => PHP_VERSION,
|
|
'memory_limit' => ini_get('memory_limit'),
|
|
'max_execution_time' => ini_get('max_execution_time'),
|
|
'error_reporting' => error_reporting(),
|
|
'display_errors' => ini_get('display_errors')
|
|
],
|
|
'message' => 'Debug API работает'
|
|
]);
|
|
} catch (Exception $e) {
|
|
http_response_code(500);
|
|
echo json_encode([
|
|
'success' => false,
|
|
'error' => $e->getMessage(),
|
|
'trace' => $e->getTraceAsString()
|
|
]);
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
|