Exception when switching from PHP 7.4 to 8.0
-
On a WP 6.1.1 install running on PHP 7.4, when switching the site to run under PHP 8.0, AIO starts throwing a fatal exception in WP Dashboard.
PHP Fatal error: Uncaught Error: Call to undefined function parse_ini_file() in /home/xxxx/public_html/wp-content/plugins/all-in-one-wp-security-and-firewall/classes/wp-security-utility-firewall.php:103
The offending function is below and the parse_ini_file is the offending line of code. Switching back to PHP 7.4 resolves the issue. I have removed the plugin and reinstalled it, to no avail. (On a side note, even with the option set to delete database tables upon deleting, the database tables remain.) I have even manually removed the db tables and reinstalled the plugin while running the site under PHP 8.0, but it still throws the same exception.
Any ideas on what to try next?
public static function get_already_set_directive($source = '') { if (!empty($source)) { clearstatcache(); if (file_exists($source) && is_readable($source)) { $vals = @parse_ini_file($source); // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged -- ignore this if (false !== $vals && isset($vals['auto_prepend_file'])) { return $vals['auto_prepend_file']; } } } else { $directive = ini_get('auto_prepend_file'); if (false !== $directive) { return $directive; } } return ''; }
Thank you!
- The topic ‘Exception when switching from PHP 7.4 to 8.0’ is closed to new replies.