Running IMagick from subfolders

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
thestarfishalliance
Posts: 1
Joined: 2016-03-02T22:21:00-07:00
Authentication code: 1151

Running IMagick from subfolders

Post by thestarfishalliance »

Running getNumberImages() to get a page count of a pdf file, and it works fine when I run it from the root of my website.

I need to run it from a different directory, if I move the file to the new location, I get the "Fatal error: Class 'Imagick' not found in ..." error.

I feel like this is an easy fix, but I just can't wrap my brain around it.

The code that works is... (This throws the page count to the screen.)

Code: Select all

$document = new Imagick('http://website.com/pdf_upload/CCE02112016_0004.pdf');  
$Count = ($document->getNumberImages()); 
echo $Count;
I would like to run the script from inside the http://websitename.com/pdf_upload folder

Any ideas?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Running IMagick from subfolders

Post by Bonzo »

Would have thought Imagick would run from any folder.

You have posted the code that works; what about the code that does not work?
Post Reply