When I run this code:
$img = new Imagick('ttt.jpg');
$quality = $img->getImageCompressionQuality();
echo $quality;
then I get the error:
PHP Fatal error: Uncaught ImagickException: open_basedir restriction in effect. File(ttt.jpg) is not within the allowed path(s)
and the script crashes.
I know hot to fix this, but how can I check if this will happen before it will happen?
I tried this:
$readable = @is_readable('ttt.jpg');
if(!$readable) {
echo 'not readable';
}else{
$img = new Imagick('ttt.jpg');
$quality = $img->getImageCompressionQuality();
echo $quality;
}
but the condition is always true