Apache和CLI中的PHP使用相同的php.ini文件但在Apache ImageMagick中没有支持的格式

What would cause this discrepancy in the supported formats?

php -ini on the command line:

imagick

imagick module => enabled
imagick module version => 3.4.3
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator
Imagick compiled with ImageMagick version => ImageMagick 6.7.7-10 2017-07-31 Q16 http://www.imagemagick.org
Imagick using ImageMagick library version => ImageMagick 6.7.7-10 2017-07-31 Q16 http://www.imagemagick.org
ImageMagick copyright => Copyright (C) 1999-2012 ImageMagick Studio LLC
ImageMagick release date => 2017-07-31
ImageMagick number of supported formats:  => 213
ImageMagick supported formats => 3FR, A, AAI, AI, ART, ARW, AVI, AVS, B, BGR, BGRA, BIE, BMP, BMP2, BMP3, BRF, C, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FITS, FRACTAL, FTS, G, G3, GIF, GIF87, GRADIENT, GRAY, GROUP4, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, ICB, ICO, ICON, INFO, INLINE, IPL, ISOBRL, J2C, J2K, JBG, JBIG, JNG, JP2, JPC, JPEG, JPG, JPX, K, K25, KDC, LABEL, M, M2V, M4V, MAC, MAP, MAT, MATTE, MEF, MIFF, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, O, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG24, PNG32, PNG8, PNM, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, R, RADIAL-GRADIENT, RAF, RAS, RGB, RGBA, RGBO, RLA, RLE, SCR, SCT, SFW, SGI, SHTML, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UIL, UYVY, VDA, VICAR, VID, VIFF, VST, WBMP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, Y, YCbCr, YCbCrA, YUV

Directive => Local Value => Master Value
imagick.locale_fix => 0 => 0
imagick.progress_monitor => 0 => 0
imagick.skip_version_check => 0 => 0

. Output of phpinfo() in the browser:

Imagick phpinfo()

Where both are using /opt/bitnami/php/etc/php.ini

$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

1个回答



我注意到在Apache phpinfo()输出的Environment部分中未设置以下环境变量,但它们是在 CLI:</ p>

  MAGICK_CODER_MODULE_PATH 
MAGICK_CONFIGURE_PATH
MAGICK_HOME
</ code> </ pre>

将以下内容添加到 / opt / bitnami / scripts / setenv.sh </ code>可以解决这个问题:</ p>

  ##### APACHE ENV ##### 
MAGICK_HOME = / usr / lib / x86_64-linux -gnu / ImageMagick-6.7.7 /
export MAGICK_HOME
MAGICK_CONFIGURE_PATH = / etc / ImageMagick /
export MAGICK_CONFIGURE_PATH
MAGICK_CODER_MODULE_PATH = / usr / lib / x86_64-linux-gnu / ImageMagick-6.7.7 / modules-Q16 / coders
export MAGICK_CODER_MODULE_PATH
</ code> </ pre>
</ div>

展开原文

原文

I noticed that in the Environment section of the Apache phpinfo() output the following environment variables were not set, but they were set in the CLI:

MAGICK_CODER_MODULE_PATH
MAGICK_CONFIGURE_PATH
MAGICK_HOME

Adding the following to /opt/bitnami/scripts/setenv.sh did the trick:

##### APACHE ENV #####
MAGICK_HOME=/usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/
export MAGICK_HOME
MAGICK_CONFIGURE_PATH=/etc/ImageMagick/
export MAGICK_CONFIGURE_PATH
MAGICK_CODER_MODULE_PATH=/usr/lib/x86_64-linux-gnu/ImageMagick-6.7.7/modules-Q16/coders
export MAGICK_CODER_MODULE_PATH 

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐