What is the potential cause of the "Call to undefined function ImageCreateFromJPEG()" error in the provided PHP script?

The "Call to undefined function ImageCreateFromJPEG()" error occurs when the GD library is not enabled in PHP. To solve this issue, you need to enable the GD extension in your PHP configuration.

// Check if GD extension is enabled
if (!extension_loaded('gd')) {
    die('GD extension is not enabled. Please enable it in your PHP configuration.');
}

// Your code that uses ImageCreateFromJPEG() function