简体   繁体   English

Imagick无法保存文件

[英]File won't save with Imagick

I have not changed anything on my website, but recently when users use the form for uploading an image, the file won't save with Imagick. 我的网站上没有任何更改,但是最近,当用户使用该表格上载图像时,该文件将无法通过Imagick保存。 There is no error. 没有错误。 Here is a snippet: 这是一个片段:

$file = $_FILES['foto']['tmp_name'];

$im = new Imagick($file);

$im->setImageBackgroundColor(new ImagickPixel("white"));
$im->setFormat ("jpg");
$im->cropThumbnailImage(100,100); 
$im->writeImages('/path/to/thumb0000.jpg',false);

Edit: Thanks to TK, I found the following message in the error-log: 编辑:感谢TK,我在错误日志中找到以下消息:

PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/imagick.so' - libMagickWand.so.2: can not open shared object file: No such file or directory in Unknown on line 0. 

Solved: I have installed the package php-pecl-imagick and everything works again! 解决:我已经安装了php-pecl-imagick软件包,一切都可以正常工作!

Your write destination is absolute and unlikely writable by the www user. 您的写入目标是绝对的,并且www用户无法写入。

 $im->writeImages('/path/to/thumb0000.jpg',false);

Check your actual path and make sure it exists, and you can write there 检查您的实际路径并确保它存在,您可以在此处写

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM