0

Ubuntu: 16.04 LTS

PHP: 5.6

I quite don't understand what's going wrong. I've installed Intervention from as guided here

Then I created the following .php file and started my localhost Apache server and tested the results and it worked!

Here's the code:

test.php

<?php
require 'vendor/autoload.php';
use Intervention\Image\ImageManagerStatic as Image;
Image::configure(array('driver' => 'gd'));
$image = Image::make('ar.jpg');
$path = 'public/images/photoh.png';
$image->save($path);
?>

But when I run the same file using php test.php in Ubuntu terminal, I get the following error:

GD Library extension not available with this PHP installation.

When I checked the phpinfo(), I saw gd being listed there with version 2.1.0

This is not the real issue, but still I would like to know what can be wrong and how can I solve it.

Then comes the real problem. I installed Imagick separately using following command:

sudo apt-get install php-imagick

This installed Imagick 6.8 on my system (I checked this using convert -version)

Then I added following to php.ini file:

extension=imagick.so

And then for testing, I changed the driver to 'imagick' in test.php and executed it using php in terminal and it worked fine.

But I want it to work on browser, like GD, but IT DIDN'T.

It showed the similar error that GD showed on terminal:

ImageMagick module not available with this PHP installation.

So it seems like ImageMagick is installed but something is missing. I think it has something to do with the native PHP 7 that comes with Ubuntu. I have tried at least 50 solutions during last month but couldn't solve this problem :(

Is there something I can do?

1 Answer 1

0

Did you try to restart services?

php --ri imagick; echo "Exit Code: $?"

imagick

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

Directive => Local Value => Master Value
imagick.locale_fix => 0 => 0
imagick.skip_version_check => 1 => 1
imagick.progress_monitor => 0 => 0
Exit Code: 0

if everything is OK, restart your web service and fpm.

service php7.0-fpm restart

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .