PHP 7.2 Error

mattmaltarich's Avatar


20 Dec, 2018 01:46 PM

Hi, I upgraded to PHP 7.2 and am encountering a few errors. The first is this: "Cannot redeclare ImageCreateFromBMP()". It's happening in the utils.php file. From googling, it seems that PHP 7.2 has a built-in function with the same name. I tried renaming the function, but I get a syntax error in the file after doing so.

  1. Support Staff 1 Posted by Ryan Haudenschi... on 21 Dec, 2018 12:34 PM

    Ryan Haudenschilt's Avatar

    This is an existing problem that has been fixed in 3.8.0. You can take a look at the github issue for more info.

    The easiest fix is to just wrap the function in an if statement.

    if (!function_exists('ImageCreateFromBMP')) {
        function ImageCreateFromBMP()
            ... code is here ...
  2. 2 Posted by mattmaltarich on 21 Dec, 2018 01:29 PM

    mattmaltarich's Avatar

    Great! Why didn't I think of that?! Worked like a charm. thanks again!


Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac