When contact-config.php exists but is unreadable by PHP-FPM (e.g. owned by www-data while pool runs as nginx), file_exists() returns true but require_once throws a fatal error → 500. Production was hitting this: contact-config.php was 'www-data:www-data 640' but the sag24 PHP-FPM pool runs as 'nginx'. Form returned HTTP 500 on every POST including legitimate ones — contact form effectively dead. Server side: chown nginx:nginx /opt/www/sag24.ru/contact-config.php (already applied). This commit makes the script defensive against the same scenario in the future.
7.9 KiB
7.9 KiB