Skip to content
Advertisement

Plesk website – PHP open_basedir restriction in effect. File is not within the allowed path

I’m trying to run this code:

$img = new Imagick('ttt.jpg');
$quality = $img->getImageCompressionQuality();
echo $quality;

I have two websites which have this code and they are running on plesk.

This code works fine on one of the websites but on the other one I get:

open_basedir restriction in effect. File is not within the allowed path

I gave the permission of 777 to the folder and containing files.

Both websites are using PHP 7.3 and therefore the same php.ini file

I’m using Plesk and Windows Server 2016

What am I missing?

Advertisement

Answer

Ok I got it, it’s in the PHP settings of each website, there is an option called open_basedir which is set to none on the website on which the imagick code works

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement