pngquant
but not with ImageMagick's convert
convert
but works fine with pngquant
(notice that both commands open same image file in same folder, same permissions, same user, etc). convert
works perfect (user has enough privileges to read/write the image files). exec('convert ...')
or shell_exec('convert ...')
as nobody, this means echo shell_exec('whoami');
returns "nobody". Same for pngquant
but with successful result (no "Permission denied" problem). Any clues?
Since I don't have root access, I've built ImageMagick and added it to the PATH.
What are the permissions on the binary you created? Sounds like you—as the user—have rights to execute the binary. But PHP—who is running as nobody
—does not have execution rights. I bet your binary permissions for what you created are something like 744
or maybe even 700
? I would recommend chmod 755
on the binaries you created and try again.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.