Solved

ImageMagick in PHP, Windows/Apache

Posted on 2010-08-27
6
2,024 Views
Last Modified: 2013-12-13
My situation:

Windows Vista
Apache 2
PHP 5.3
ImageMagick 6.6.3 Q16

ImageMagick works through the command line, and from php via passthru or exec.

problem:  cannot get Imagick (the PHP extension class for communicating with ImageMagick) working.

phpinfo does not show the Imagick module.

When attempting to instance through PHP:
  Fatal error: Class 'Imagick' not found

I’ve tried multiple DLLs, most recently one from http://valokuva.org/?page_id=50.

This line is in php.ini:
  extension=php_imagick.dll

php.ini extension dir is:
  extension_dir=C:\PHP\ext

php_imagick.dll exists in C:\PHP\ext

added environment variable to apache, which shows up via phpinfo as:
  _SERVER["MAGICK_HOME"]      C:/ImageMagick

C:/ImageMagick is the correct installation directory

phpinfo show configuration file as:
  C:\PHP\php.ini

this is the correct configuration file, and the file that reflects the edits mentioned above.

i'd be grateful for any advice
0
Comment
Question by:moagrius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 40

Accepted Solution

by:
Richard Quadling earned 500 total points
ID: 33548753
Go to the command prompt.

Type ...

php -d display_startup_errors=1 --re imagick

0
 
LVL 19

Author Comment

by:moagrius
ID: 33549135
awesome - thanks.

apparently i need the VC6 dll:

PHP Warning:  PHP Startup: imagick: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP    compiled with build ID=API20090626,TS,VC6
These options need to match

i remembered finding it yesterday at http://www.sk89q.com/downloads/imagick/2.3.0/API20090626-TS-VC6/php_imagick.dll, but the site's down :/

it was up yesterday, so worst case i'll just keep trying throughout the day.

before i close this post, any chance you know where i might find a copy elsewhere?  every result on google just pointed to the above dead link...

thanks a ton
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33549438
The safest bet is to build it yourself. Not an overly complicated process, but you do need to build the right version. Which could be hard as getting hold of a VC6 compiler is not easy (legally).

You can drop the PHP Windows mailing list a request (See http://docs.php.net/mailing-lists.php).

Normally a very helpful chap called Pierre will point you in the right direction.

Unfortunately, the PECL4Win site has been down for several years. This site had all the version.

Maybe one day.
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 19

Author Comment

by:moagrius
ID: 33549573
the site's back up - dl'ed the VC6 dll - restarted apache - imagick now listed in the modules, so moving forward

just saw that i'm getting another error when instancing, but at least it's loaded

thanks for the tip
0
 
LVL 19

Author Closing Comment

by:moagrius
ID: 33549579
thanks
0
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 33549592
It's a complicated old world now with 2 C versions (VC6/VC9), 2 chipsets (x86/x64), 2 threading models (ts/nts), different SAPIs (ISAPI, FastCGI, Apache, Apache2.2, cli), etc.

And then the PHP versions.

And then matching them all up so the extensions agree with the main core...

It's remarkable anything ever works.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding additional variables to key => value association 17 39
Survey branching tutorial 11 45
What is define("__APPROOT__", __DIR__); 6 33
deprecated mysql extensions 1 30
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question