What it checks
Checks display_errors, expose_php, allow_url_include, allow_url_fopen and similar settings.
Check ID: php.ini
The php.ini values that apply to the web server are checked. As with the PHP version, a scan on WP-CLI uses the values recorded during web requests.
| Setting | Reported when |
|---|---|
display_errors | On |
expose_php | On |
allow_url_include | On |
allow_url_fopen | On |
log_errors | Off |
session.cookie_httponly | Off |
What a finding means
The titles, severities and explanations below are the ones shown on the Findings screen.
| Finding | Severity | Meaning |
|---|---|---|
display_errors is onini.display_errors | High | PHP errors are shown to visitors. Error messages reveal file paths and code structure. |
expose_php is onini.expose_php | Low | The PHP version is sent in the X-Powered-By header, which helps attackers pick exploits. |
allow_url_include is onini.allow_url_include | Critical | include/require can load code from remote URLs, which turns file inclusion bugs into remote code execution. |
allow_url_fopen is onini.allow_url_fopen | Low | File functions can open remote URLs. WordPress does not need this (it uses the HTTP API), but some code may rely on it. |
log_errors is offini.log_errors | Low | PHP errors are not logged, so problems and attacks may go unnoticed. |
session.cookie_httponly is offini.session.cookie_httponly | Info | PHP session cookies can be read by JavaScript. WordPress itself does not use PHP sessions, but other code may. |
How to fix
The recommended action shown with each finding:
- display_errors is on
Set display_errors = Off and log errors instead (log_errors = On). - expose_php is on
Set expose_php = Off in php.ini (or the hosting control panel). - allow_url_include is on
Set allow_url_include = Off. - allow_url_fopen is on
Turn it off if no code on the site depends on it. - log_errors is off
Set log_errors = On and make sure the log is not publicly accessible. - session.cookie_httponly is off
Set session.cookie_httponly = On.
Related settings
- Settings → Checks → Enabled checks: switch “PHP settings” on or off.