From bf1c7e5d02dac1023f336b12e07d9f0f9e8a034b Mon Sep 17 00:00:00 2001 From: Kirik Date: Wed, 3 Sep 2025 15:14:39 +0200 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B0=20send=5Fpl?= =?UTF-8?q?an=5Fsimple.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Добавлен вывод текущей директории и списка файлов - Более подробные сообщения об ошибках с контекстом - Логирование в error_log для диагностики на сервере - Помогает понять структуру файлов на VPS --- static/api/send_plan_simple.php | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/static/api/send_plan_simple.php b/static/api/send_plan_simple.php index c158a7f..878e3af 100644 --- a/static/api/send_plan_simple.php +++ b/static/api/send_plan_simple.php @@ -7,19 +7,38 @@ // Отладочная информация error_log("send_plan_simple.php запущен"); +// Проверяем текущую директорию и файлы +$current_dir = __DIR__; +$available_files = scandir($current_dir); + +error_log("Текущая директория: " . $current_dir); +error_log("Файлы в директории: " . implode(', ', $available_files)); + // Проверяем существование файлов (в той же папке /api/) -$helper_path = './forms_helper.php'; -$env_path = './.env'; +$helper_path = __DIR__ . '/forms_helper.php'; +$env_path = __DIR__ . '/.env'; if (!file_exists($helper_path)) { + error_log("ОШИБКА: forms_helper.php не найден: " . $helper_path); http_response_code(500); - echo json_encode(['error' => 'forms_helper.php не найден по пути: ' . $helper_path]); + echo json_encode([ + 'error' => 'forms_helper.php не найден', + 'path' => $helper_path, + 'current_dir' => $current_dir, + 'files' => $available_files + ]); exit; } if (!file_exists($env_path)) { + error_log("ОШИБКА: .env не найден: " . $env_path); http_response_code(500); - echo json_encode(['error' => '.env файл не найден по пути: ' . $env_path]); + echo json_encode([ + 'error' => '.env файл не найден', + 'path' => $env_path, + 'current_dir' => $current_dir, + 'files' => $available_files + ]); exit; }