• Resolved jasolution

    (@jasolution)


    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author David Anderson / Team Updraft

    (@davidanderson)

    The parse_ini() function still exists in PHP 8 – https://www.php.net/manual/en/function.parse-ini-file.php . So if it’s not existing in your particular install, presumably the server administrator has explicitly removed it in the PHP configuration? Can you ask him why he’s done that, to help us understand why someone would choose to do that?

    Thread Starter jasolution

    (@jasolution)

    Thank for the speedy response, David. You were correct about that function being disabled and it was due to a configuration error that was easily corrected. Much obliged for your support and fast response.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exception when switching from PHP 7.4 to 8.0’ is closed to new replies.