Page 1 of 1

Running IMagick from subfolders

Posted: 2016-03-02T23:16:18-07:00
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?

Re: Running IMagick from subfolders

Posted: 2016-03-03T08:41:10-07:00
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?