Add memory_limit/max_execution_time sanity checks (#106)
config/requirements.php only checked PHP version and 6 extensions. A deployment on a host with a low default memory_limit (e.g. shared- hosting-style 128M) passed the startup requirements check cleanly and only surfaced as a mysterious failure under real load — a large CSV export, an oversized dashboard query on a big install. Added min_memory_limit_mb (256) and min_max_execution_time (30s) thresholds to config/requirements.php, checked as warnings (not hard failures, since a low limit doesn't break every request) in both scripts/check_requirements.php (CI) and api/health.php (production monitoring). -1/0 (unlimited) always passes. Verified the ini-size parsing and warning logic directly with low/high/unlimited memory_limit and max_execution_time values. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MGDKHiU5RJdo3dqQUDow3X
This commit is contained in:
@@ -25,4 +25,11 @@ return [
|
||||
'fileinfo', // api/upload_attachment.php — MIME validation
|
||||
'json', // request/response encoding (bundled, but assert anyway)
|
||||
],
|
||||
|
||||
// Sanity-check thresholds (warnings, not hard failures). A host with a low
|
||||
// default memory_limit passes a bare extension/version check cleanly and
|
||||
// only surfaces as a mysterious failure under real load — a large CSV
|
||||
// export, an oversized dashboard query on a big install.
|
||||
'min_memory_limit_mb' => 256,
|
||||
'min_max_execution_time' => 30, // seconds; 0 (unlimited) always passes
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user