The issue is caused by the server's open_basedir restriction, which prevents PHP from accessing certain directories outside the allowed paths. The issue likely occurs when PHP checks the existence of the image file (in this line): if (file_exists($image) && is_file($image))... This file_exists() check triggers the error because it tries to access a file in a directory that the server configuration restricts. You can either expand the allowed paths or disable open_basedir to resolve the error.