PHP 7.2 Error

mattmaltarich's Avatar

mattmaltarich

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!

    -Matt

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

Generic

? 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

Recent Discussions

18 Jan, 2019 08:12 PM
13 Jan, 2019 12:22 AM
27 Dec, 2018 07:44 AM
21 Dec, 2018 01:29 PM
18 Dec, 2018 02:39 PM