windows imagick 与 PHP 5.3 崩溃
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8608426/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
imagick crash with PHP 5.3
提问by Daniel
I'm getting this error:
我收到此错误:
The connection to the server was reset while the page was loading.
加载页面时,与服务器的连接已重置。
This only occurs when I try to load an image using ImageMagick.
这仅在我尝试使用 ImageMagick 加载图像时发生。
<?php
header('Content-type: text/html');
$image = 'some_image.jpg';
/*** a new imagick object ***/
$im = new Imagick();
/*** ping the image ***/
$im->pingImage($image);
/*** read the image into the object ***/
$im->readImage( $image );
/**** convert to png ***/
$im->setImageFormat( "png" );
/*** write image to disk ***/
$im->writeImage( '/tmp/new.png' );
echo 'Image Converted';
?>
vertrigo serv
php 5.3.8
php_imagick_ts.dll
Apparently same problem here: http://valokuva.org/?page_id=50
这里显然是同样的问题:http: //valokuva.org/?page_id=50
I can get it loaded, phpinfo displays imagick information, but when trying to read an image Apache crashes.
我可以加载它,phpinfo 显示 imagick 信息,但是在尝试读取图像时 Apache 崩溃了。
Any idea about this problem?
对这个问题有什么想法吗?
采纳答案by BartekR
There is similar problem: Imagick constructor crashes PHP/CGI
有类似的问题:Imagick 构造函数崩溃 PHP/CGI
I've had the same issue today. You have to install version of Image Magick no higher than 6.6.4.0 - next builds are made using VC10 which seems to be incompatible with Apache VC9 + PHP5.3.x VC9.
我今天遇到了同样的问题。您必须安装不高于 6.6.4.0 的 Image Magick 版本 - 下一个版本是使用 VC10 制作的,这似乎与 Apache VC9 + PHP5.3.x VC9 不兼容。
Some comments on this: http://valokuva.org/?p=161#comment-20707
对此的一些评论:http: //valokuva.org/?p=161#comment- 20707
You can get older releases of Image Magick here: http://image_magick.veidrodis.com/image_magick/binaries/
您可以在此处获取旧版本的 Image Magick:http: //image_magick.veidrodis.com/image_magick/binaries/
And remember to reboot windows after installing Image Magick
并记得在安装 Image Magick 后重新启动 Windows
回答by Tom
I just got the same error in my new server, if using PHP "new Imagick("$imagebath")"
如果使用 PHP "new Imagick("$imagebath")",我在我的新服务器中遇到了同样的错误
the fix is:
解决方法是:
set "php.ini" "memory_limit = 256M" (or more, it was 128, it's not enough), error log: "Out of memory in UB xxx: OOM killed process x (httpd)..." So the request was reset to browser.
set "php.ini" "memory_limit = 256M" (or more, it was 128, it's not enough), error log: "Out of memory in UB xxx: OOMkilled process x (httpd)..." 所以请求是重置浏览器。
回答by Johnny Wind
In PHP 5 the file has to be php5.ini
Add these lines in php5.ini
在 PHP 5 中,文件必须是php5.ini
在 php5.ini 添加这些行
post_max_size = 48M
file_uploads = On
upload_max_filesize = 192M
You can set the sizes to whatever you want.
您可以将大小设置为任何您想要的。