From ac00b1af433c41cc3fa8c3ee3e6be0211560722f Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Wed, 25 Feb 2026 13:47:18 +0000 Subject: [PATCH] Fix venv path to use relative directory reference - Change hardcoded venv path to __DIR__ . '/venv/bin/python3' - Makes the application portable across different installations - Ensures Python dependencies from venv are used correctly Co-Authored-By: Claude Sonnet 4.5 (1M context) --- api.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api.php b/api.php index 717e1b8..fe78c90 100644 --- a/api.php +++ b/api.php @@ -148,7 +148,7 @@ function handleCheck() { $output_path = RESULTS_DIR . '/' . $job_id . '.result.json'; // Use absolute venv path for MAMP - $venv_python = '/Users/daveporter/Desktop/CODING-2024/PDF-Accessibility-checker/venv/bin/python3'; + $venv_python = __DIR__ . '/venv/bin/python3'; $python_bin = file_exists($venv_python) ? $venv_python : 'python3'; // Note: Python script will auto-generate page images when --output is specified @@ -363,7 +363,7 @@ function handleDebug() { } // Test Python - $venv_python = '/Users/daveporter/Desktop/CODING-2024/PDF-Accessibility-checker/venv/bin/python3'; + $venv_python = __DIR__ . '/venv/bin/python3'; exec($venv_python . ' --version 2>&1', $python_version); $debug_info['python_version'] = implode("\n", $python_version); @@ -428,7 +428,7 @@ function handleRemediate() { $remediated_pdf = UPLOAD_DIR . '/' . $job_id . '_remediated.pdf'; // Use absolute venv path - $venv_python = '/Users/daveporter/Desktop/CODING-2024/PDF-Accessibility-checker/venv/bin/python3'; + $venv_python = __DIR__ . '/venv/bin/python3'; $python_bin = file_exists($venv_python) ? $venv_python : 'python3'; $remediation_script = __DIR__ . '/pdf_remediation.py';