Solved

ImageMagick in PHP, Windows/Apache

Posted on 2010-08-27
6
2,040 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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…

617 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