Unable to upload images via PHP all of a sudden

Operating System & Version
CENTOS 7.9 kvm
cPanel & WHM Version
v96.0.11

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Hi all,

I am getting a strange error in PHP (ea-php74) all of a sudden when attempting to upload a file:

ImagickException: unable to open file `/tmp/magick-32546Fb5hihS2N2mt': No such file or directory @ error/constitute.c/ReadImage/604 in /home/foobar/public_html/Image.php:25

I tried to search for this error but didn't have much luck. Any ideas how I can debug this please? I have updated Imagick to 3.5.0 via cPanel but no change.

Thanks kindly
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,285
2,434
363
cPanel Access Level
Root Administrator
Hey there! I searched for the "ImagickException: unable to open file" portion of the error, and all the replies I found pointed to permissions issues. Is /tmp set to 1777 permissions on the machine?

It also might be worth reaching out to the provider of your script to see if they had additional ideas on the problem.
 

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Thank you for the reply, @cPRex.

I found similar results but none of it panned out, which is why I posted here.

/tmp is set to drwxrwxrwt. Is that incorrect in any way?

I wrote the code in question, which is why it's a little odd that it's happening all of a sudden as I haven't touched the code in awhile.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,285
2,434
363
cPanel Access Level
Root Administrator
Nope, those are the correct permissions.

I haven't seen anything odd related to Imagick or ImageMagick on my end recently, so if you wanted us to take a deeper look you're always welcome to submit a ticket to our support team. If you do that, please post the number here so I can make sure this thread stays updated with any details we find.
 

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Thank you again. I checked that, but php74-php-gd is in fact installed. I can see in phpinfo() and GD and WebP are both enabled. That kind of leads me to wonder if it might be a cPanel issue?
 

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Thanks again. I went through the process and was auto-suggested this how-to:


that requires me to uninstall the existing ImageMagick, which I'm more than a bit hesitant to do as I don't know the implications in terms of support, future updates, etc. :/ There has to be a better solution?
 

4pples

Member
Jan 25, 2021
18
0
1
Canada
cPanel Access Level
Root Administrator
Customization to the current version of what specifically please? PHP? Imagick? This is one of the reasons why I went with cP - so I wouldn't have to do this kind of work anymore. :/ Inevitably I bugger something up.