• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Uncaught ImagickException: unable to open file /tmp/magick-19187PLk9nfNAo48O

pvl

New Pleskian
Hey!
When trying to process an image already uploaded to the server using Imagick, I get the error Uncaught ImagickException: unable to open file /tmp/magick-19187PLk9nfNAo48O. Tell me, what could be causing it?
thank
 
If I remember correctly, you cannot directly work on temporary files. I think the reason was that once a file is uploaded and nothing else is done with it, it is auto-removed from the tmp location. For that reason you are seeing the "unable to open". The file is no longer there to open it.

Instead, after the upload first move the file into a place inside your subscription where you could equally well open it with an editor, then apply the imagick functions to that file.
 
If I remember correctly, you cannot directly work on temporary files. I think the reason was that once a file is uploaded and nothing else is done with it, it is auto-removed from the tmp location. For that reason you are seeing the "unable to open". The file is no longer there to open it.

Instead, after the upload first move the file into a place inside your subscription where you could equally well open it with an editor, then apply the imagick functions to that file.
Hi!
Not certainly in that way. The file has been uploaded to the server for a long time and is in the subscription. I tried to set the value {WEBSPACEROOT} {/} {:} {TMP} {/}: / tmp in the php settings for this subscription in the open_basedir field, but the problem was not solved.
 
That is, there is a code
Code:
(43)        $this->im = new Imagick;
(44)        $this->im->readImage($file);
The variable $ file is set
Code:
dumped from /var/www/vhosts/*******/httpdocs/wa-system/image/waImageImagick.class.php line #40:
'/var/www/vhosts/*****/httpdocs/wa-data/protected/shop/products/84/07/784/images/3100.jpg'
And on line 44 the execution is interrupted
[error] 23164#0: *722953 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught ImagickException: unable to open file `/tmp/magmagick-9444K1dDg69Y4DtY': No such file or directory @ error/constitute.c/ReadImage/544 in /var/www/vhosts/****/httpdocs/wa-system/image/waImageImagick.class.php:44
Stack trace:
#0 /var/www/vhosts/******/httpdocs/wa-system/image/waImageImagick.class.php(44): Imagick->readimage('/var/www/vhosts...')
............
Code:
/var/www/vhosts/******/httpdocs/wa-data/protected/shop/products/84/07/784/images# ls -l

-rw-r--r-- 1 ****** psacln 480975 Aug  9  2020 3099.jpg
-rw-r--r-- 1 ****** psacln  18132 Aug  9  2020 3100.jpg
 
UPD
The file 3100.jpg is in webp format despite the jpg extension. Apparently, need to tweak Imagick itself or install an additional library?
 
Back
Top