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
Solved

ImageMagick in PHP, Windows/Apache

Posted on 2010-08-27
6
2,019 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:
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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

809 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