I have image exist and I can see it in both folder and browser but file_exists return always false. I did try 3 different paths but always return false I did try with :
$backgroundImage = '/var/www/html/hmhb/bramijpadv2/uploads/space_banner/thmbs/20220203/047c7c10-69d5-47a2-996b-d1e938e0c3df/image01.jpg';
return false
$backgroundImage = 'http://127.0.0.1/hmhb/bramijpadv2/uploads/space_banner/thmbs/20220203/047c7c10-69d5-47a2-996b-d1e938e0c3df/image01.jpg';
return false
$backgroundImage = '/hmhb/bramijpadv2/uploads/space_banner/thmbs/20220203/047c7c10-69d5-47a2-996b-d1e938e0c3df/image01.jpg';
return false
I did change permission to 777 I was thinking it's the problem but getting same result false
protected function hasImage($backgroundImage)
{
if (file_exists($backgroundImage))
{
return 'Image exist';
}
else{
return 'No Image exist';
}
}