NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Using Imagemagick


Joined: 05 Aug 2017
Posts: 8
Reply with quote
I'm trying to use Imagemagick in a PHP script. I've downloaded all the DLLs and put php_imagick.dll in the php82\extensions folder. I've added the extension in php.ini (extension=php_imagick.dll and extension=imagick). If I create a php script and instantiate a new imagick object ($im = new Imagick()Wink, the popup help recognises it and will display the class methods & preperties. If I try to run the script in the debugger I get this error:

Fatal error: Uncaught Error: Class "Imagick" not found in C:\PHP Web Site\Test.php:2 Stack trace: #0 {main} thrown in C:\PHP Web Site\Test.php on line 2

I've tried searching on how to set up ImageMagick in php and it looks like other people have had problems with it. I'm currently using the latest version of PhpEd on Windows 10. I've tried putting the various DLLs in differnt locations but with no success.

Has anyone managed to install it successfully and if so, what else do I need to do?
View user's profileFind all posts by DementedGibbonSend private message


Joined: 05 Aug 2017
Posts: 8
Reply with quote
Did a bit more digging and found this in the Windows event log:-

php[9704]
PHP Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20210902
PHP compiled with module API=20220829
These options need to match
("C:\Program Files\NuSphere\PhpED\php82\php-cgi.exe")

I'm assuming that I need a different build of PHP? Not sure where to go with this.
View user's profileFind all posts by DementedGibbonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
you can't just copy php extension DLL from one version to another. API is different and it would crash anyway. To prevent this, the loader just checks API version the DLL built with and compares with the running php core. If they don't match, it unloads the DLL. That's it.
As of where to pick this dll up, normally you'd get 3rd parties from PECL web site https://pecl.php.net/package/imagick . The only problem -- seems the DLL is not updated for more than a year. You can try some other web sites, but I doubt you can trust them fully.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 05 Aug 2017
Posts: 8
Reply with quote
I realise that I can't use That DLL because of the different API version. I've been looking for a compatible one but haven't found one yet. I was wondering if anyone else has.
View user's profileFind all posts by DementedGibbonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
all official builds of 3rd party PECL extensions for Windows can be downloaded from the link below
https://windows.php.net/downloads/pecl/releases/
If one is not available from this web site, you can ask maintainers in the corresponding php newsgroups https://pecl.php.net/support.php
As far as I can tell, the latest imagic is 3.7 for php-8.1 -- https://windows.php.net/downloads/pecl/releases/imagick/3.7.0/

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 05 Aug 2017
Posts: 8
Reply with quote
Thanks. I've just posted something on on eof the newsgroups. I'll see what I get from there.
View user's profileFind all posts by DementedGibbonSend private message
using Imagemagick


Joined: 05 Aug 2017
Posts: 8
Reply with quote
This isn't anything to do with imagemagick. Are you posting to the wring topic?
View user's profileFind all posts by DementedGibbonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
spammer was deleted...

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Using Imagemagick
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic