Checkup
Inphinit features a tool that assists in diagnosing the environment, identifying potential issues or suggesting optimal configurations—such as those aimed at enhancing security or performance.
Using
It is possible to use the class to detect problems in the environment where the application is running, like this:
<?php
use Inphinit\Diagnostics\Checkup;
$app->action('GET', '/checkup', function () {
$check = new Checkup();
$errors = $check->getErrors();
echo implode("<br>\n", $errors);
$warnings = $check->getWarnings();
echo implode("<br>\n", $warnings);
});
When creating a new project, the /checkup in main.php route will already be configured and working to determine the conditions of the environment in which the application is running. It's possible to move the route to a context with authentication or limit it to the scope of a private host. Related files:
-
system/
-
Controllers/
- CheckupController.php
-
views/
- checkup.php
-
Controllers/
These files can be removed or completely recreated; the approach presented is just a sample of basic usage.
Possible errors
| Message | Condition |
|---|---|
| The PHP version is affected by CVE-2026-109618 and CVE-2026-109619. Upgrade PHP or look into temporary workarounds (or confirm that your distribution backported the fix) | PHP<8.2.0 |
| The PHP version is affected by CVE-2026-109618 and CVE-2026-109619. Upgrade to 8.2.35 (or confirm that your distribution backported the fix) | PHP 8.2.x < 8.2.35 |
| The PHP version is affected by CVE-2026-109618 and CVE-2026-109619. Upgrade to 8.3.36 (or confirm that your distribution backported the fix) | PHP 8.3.x < 8.3.36 |
| The PHP version is affected by CVE-2026-109618 and CVE-2026-109619. Upgrade to 8.4.27 (or confirm that your distribution backported the fix) | PHP 8.4.x < 8.4.27 |
| The PHP version is affected by CVE-2026-109618 and CVE-2026-109619. Upgrade to 8.5.12 (or confirm that your distribution backported the fix) | PHP 8.5.x < 8.5.12 |
Unexpected value in max_execution_time={$entry} (interpreted as {$value}) |
max_execution_time is not a plain integer |
Unlimited max_execution_time is unsafe in WEB context |
HTTP context and max_execution_time < 1 |
Invalid value in entry memory_limit={$entry} |
memory_limit has an invalid format |
Unlimited memory_limit is unsafe in WEB context |
HTTP context, memory_limit unlimited, PHP not vulnerable |
Invalid value in entry post_max_size={$post_max_size_entry} |
HTTP context and invalid post_max_size |
Invalid value in entry upload_max_filesize={$upload_max_filesize_entry} |
HTTP context, file_uploads enabled, invalid value |
post_max_size={$post_max_size_entry} is smaller than upload_max_filesize={$upload_max_filesize_entry} |
HTTP context, file_uploads enabled, post_max_size < upload_max_filesize |
Unexpected value in max_file_uploads={$max_file_uploads_entry} (interpreted as {$max_file_uploads}) |
HTTP context, file_uploads enabled, max_file_uploads is not a plain integer |
random_bytes() unavailable, enable the Mcrypt extension to use as fallback |
PHP<7.0 without mcrypt_create_iv |
random_bytes() unavailable; check disable_functions |
PHP>=7.0 without random_bytes() |
No such directory: {$display} |
logs, session or tmp directory missing in storage |
{$display} directory requires write permissions |
logs, session or tmp directory not writable |
Disable the deprecated magic_quotes_gpc |
PHP<8.0 and magic_quotes_gpc enabled |
Disable the deprecated always_populate_raw_post_data |
PHP<7.0 and the entry enabled |
In production environment, the display_errors must be disabled |
Not in development and display_errors enabled |
Disable the deprecated auto_detect_line_endings |
Entry enabled, PHP vulnerable and PHP>=8.1 (otherwise it is a warning) |
Possible warnings
| Message | Condition |
|---|---|
While PHP is not upgraded, set fatal_error_backtraces=0 and restart all workers (partial mitigation) |
PHP vulnerable, PHP>=8.5 and the entry enabled |
While PHP is not upgraded, set session.upload_progress.enabled=0 and restart all workers (partial mitigation) |
PHP vulnerable and the entry enabled |
filter.default={$filter} can emit a diagnostic before request startup (CVE-2026-109619); restore the default value |
PHP vulnerable, PHP>=8.1, filter extension loaded, value not unsafe_raw |
report_memleaks=0 can emit a diagnostic before request startup (CVE-2026-109619); remove it |
PHP vulnerable, PHP>=8.5 and report_memleaks disabled |
intl.error_level can emit a diagnostic before request startup (CVE-2026-109619); restore the default value (0) |
PHP vulnerable, PHP>=8.5, intl loaded and value != 0 |
{$key}={$value} can emit a diagnostic before request startup (CVE-2026-109619); remove it (use default_charset) |
PHP vulnerable, mbstring/iconv loaded, and *.http_input, *.http_output, *.internal_encoding (or iconv.input_encoding, iconv.output_encoding) set |
It is recommended to set max_execution_time between {$min_exec} and {$max_exec} in WEB context |
HTTP context and value outside 30–300 |
Unlimited memory_limit is unsafe in WEB context; it is only acceptable as a partial mitigation until PHP is upgraded |
HTTP context, memory_limit unlimited, PHP vulnerable |
memory_limit={$entry} may not be enough |
memory_limit < 16 MB |
post_max_size={$post_max_size_entry} may not be enough |
HTTP context and post_max_size < 1 MB |
post_max_size={$post_max_size_entry} is above the recommended cap while PHP is not upgraded (8M without uploads, 32M with uploads) |
HTTP context, PHP vulnerable and post_max_size > 32 MB |
upload_max_filesize={$upload_max_filesize_entry} may not be enough |
HTTP context, file_uploads enabled and value < 1 MB |
max_file_uploads={$max_file_uploads} may not be enough |
HTTP context, file_uploads enabled and max_file_uploads < 1 |
file_uploads is disabled (Off). If this is not intentional, enable it |
HTTP context and file_uploads disabled |
random_bytes() unavailable. Using Mcrypt Extension as fallback |
PHP<7.0 with mcrypt_create_iv available |
(Optional) Intl extension is required by Inphinit\Utility\String and Inphinit\Utility\Url |
\Transliterator class not available |
Disable the deprecated auto_detect_line_endings |
Entry enabled and not (PHP vulnerable and PHP>=8.1) |
While in development mode, it is recommended to disable opcache.enable |
Development, OPcache available and enabled |
While in development mode, it is recommended to disable wincache.ocenabled |
Development, WinCache available and enabled |
While in development mode, it is recommended to disable xcache.cacher |
Development, XCache available and enabled |
Set expose_php=Off to ensure the PHP version is not exposed through HTTP headers (appends or PHP easter eggs if PHP<5.5) |
HTTP context and expose_php enabled |
ini_get() is disabled, so no further checks can be performed |
ini_get() unavailable |
php_ini_loaded_file() is disabled, so some checks may be skipped |
php_ini_loaded_file() unavailable |
php.ini is not configured; Ignore this if you are using flags |
php_ini_loaded_file() returns false |