I had the same problem after switching to a new hosting server. I tried updating base_dir in PLESK, but got the same error. So, I am trying to set open_basedir in realtime as outlined in PHP.NET
FILE: file.pdf
PATHTOFILE: /var/www/vhosts/example.com/httpdocs/path/to/file/
open_basedir BEFORE SET: /var/www/vhosts/example.com/:/tmp/
open_basedir AFETR SET: /var/www/vhosts/example.com/:/tmp/:/var/www/vhosts/example.com/httpdocs/path/to/file/
Fatal error: Uncaught ImagickException: open_basedir restriction in effect. File(file.pdf[0]) is not within the allowed path(s)
However, I still got the same error.
Solution:
After setting open_basedir to none, I got a different problem, which led me to question whether ImageMagick was the problem and not open_basedir. So I installed ImageMagick on the server via SSH, and executed a simple convert command without errors.
Then I simply re-wrote the code using exec, which is much easier than dealing with the ImageMagick class:
exec('convert '.$pdf.'['.$page.']'.' -resize 200x300^ -extent 200x150 -quality 72 '.$png.'',$output,$retval);
I then reset open_basedir to its default value (not NONE), and the code still works.
So, the problem is not open_basedir; the problem must be related to the ImageMagick extension for PHP.