Solved

ImageMagick in PHP, Windows/Apache

Posted on 2010-08-27
6
2,004 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
  • 3
  • 3
6 Comments
 
LVL 40

Accepted Solution

by:
RQuadling earned 500 total points
Comment Utility
Go to the command prompt.

Type ...

php -d display_startup_errors=1 --re imagick

0
 
LVL 19

Author Comment

by:moagrius
Comment Utility
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:RQuadling
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 19

Author Comment

by:moagrius
Comment Utility
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
Comment Utility
thanks
0
 
LVL 40

Expert Comment

by:RQuadling
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
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.
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now