Site Heath crashes with Fail2ban

Using the current version of Fail2ban. This also happened in the previous version as well.

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.2.2
Current plugin: WP fail2ban (version 5.1.1)
PHP version 8.0.29

Error Details

An error of type E_ERROR was caused in line 391 of the file /sites/ Error message: Uncaught Error: Call to undefined function org\lecklider\charles\wordpress\wp_fail2ban\exec() in /sites/
Stack trace:
#0 /sites/ org\lecklider\charles\wordpress\wp_fail2ban\SiteHealth->get_test_fail2ban_running()
#1 /sites/ WP_Site_Health->perform_test()
#2 /sites/ WP_Site_Health->enqueue_scripts()
#3 /sites/ WP_Hook->apply_filters()
#4 /sites/ WP_Hook->do_action()
#5 /sites/ do_action()
#6 /sites/ require_once(‘…’)
#7 {main}

**Fatal error**: Uncaught Error: Call to undefined function org\lecklider\charles\wordpress\wp_fail2ban\exec()
in **/.../wp-content/plugins/wp-fail2ban/lib/site-health.php** on line **391**

Call stack:

1. `org\l\c\w\w\SiteHealth::get_test_fail2ban_running()`
2. `WP_Site_Health::perform_test()`
3. `WP_Site_Health::enqueue_scripts()`
4. `WP_Hook::apply_filters()`
5. `WP_Hook::do_action()`
6. `do_action()`
7. `require_once()`

Same here. Happened in v5.1.0 as well.

WC Version: 7.8.2
REST API Version: :heavy_check_mark: 7.8.2
WC Blocks Version: :heavy_check_mark: 10.5.0
Action Scheduler Version: :heavy_check_mark: 3.5.4
Log Directory Writable: :heavy_check_mark:
WP Version: 6.2.2
WP Multisite: –
WP Memory Limit: 512 MB
WP Debug Mode: :heavy_check_mark:
WP Cron: –
External object cache: :heavy_check_mark:

Server Environment

Server Info: nginx/1.18.0
PHP Version: 8.0.29
PHP Post Max Size: 64 MB
PHP Time Limit: 600
PHP Max Input Vars: 7000
cURL Version: 7.81.0

OK, so it seems PHP8 doesn’t gracefully handle having exec() disabled. Joy.

Can you try changing line 387 of wp-fail2ban/lib/site-health.php to:

if (function_exists('exec') && file_exists('/usr/bin/systemctl')) {

and let me know what happens?


That seems to have fixed the problem. The site-health is loading and displaying wp-fail2ban items correctly. Thanks!

BTW: Is it possible to disable the recommendations for Blocklist / Contactform /… Addons?

Thanks for the quick response! :slight_smile:

That resolved it. Thanks. I wasn’t worried about it - but i had another issue with a different plugin and they thought this was the issue LOL

A post was split to a new topic: Disable Site Health add-on suggestions