php 如何确定我是否安装了 gd 库或 imagemagick?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25534957/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 17:52:54  来源:igfitidea点击:

How to find out if I have gd library or imagemagick installed?

phpapacheimagemagickgdphp-5.5

提问by eddard.stark

This might seem a really stupid question. I am new php image processing. I assume there are only two imageprocessing libraries in php. They are called GD/GD2 and Imagemagick. How do I know which I have installed? or if I have installed any? I have echo-ed phpinfo. It just says that GD imaging was created by Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye, Marcus Boerger. I am really confused. Thanks in advance.

这似乎是一个非常愚蠢的问题。我是新的 php 图像处理。我假设 php 中只有两个图像处理库。它们被称为 GD/GD2 和 Imagemagick。我怎么知道我安装了哪个?或者如果我安装了任何?我已经回显了 phpinfo。它只是说 GD 成像是由 Rasmus Lerdorf、Stig Bakken、Jim Winstead、Jouni Ahto、Ilia Alshanetsky、Pierre-Alain Joye、Marcus Boerger 创建的。我真的很困惑。提前致谢。

回答by Michael Berry

If you can get to the console of the server running PHP, type:

如果您可以访问运行 PHP 的服务器的控制台,请键入:

php -i | grep 'GD\|ImageMagick'

This will tell you if GD or ImageMagick is installed and running.

这将告诉您 GD 或 ImageMagick 是否已安装并正在运行。

回答by Yevgeniy Afanasyev

This is also a good answer that helped me. Thank you @Class

这也是一个很好的答案,对我有帮助。谢谢@Class

if(extension_loaded('gd')){/*loaded*/}

回答by Niyas Niya

Just type in:

只需输入:

yum info gd

百胜信息gd

which shows all the details about about gd library installed..

它显示了有关安装的 gd 库的所有详细信息..