logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in  RSS Apache Lounge  


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.


Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: php_imagick problems (Windows, php 7.4.21) Page 1, 2  Next
Author
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Fri 23 Jul '21 0:38    Post subject: php_imagick problems (Windows, php 7.4.21) Reply with quote

I have had zero issues with this in years. Prior to that, we were always having trouble getting this to work. Suddenly, this is failing on 2 machines (maybe more, but we know of 2 for sure, both dev machines). Nothing has changed - no updates, no config, nothing, just suddenly, on 2 dev machines it fails. This does not fail on at least 1 other dev machine and our test machine (luckily also not failing in production).

C:\windows\system32>C:\PHP\php.exe -cC:/php/devrc/php.ini -m

Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: ext\imagick (The specified module could not be found.), ext\php_imagick.dll (The specified module could not be found.)) in Unknown on line 0

I have tried everything I can think, and as far as I can tell, these are identical. Using the php_imagick.dll and artificat that Jan E creates.

Help!
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Sat 24 Jul '21 1:38    Post subject: Reply with quote

I even took a brand new VM. Copied the files from the failing machine (c:\PHP and c:\imagemagick) to that machine. Installed vcredist140. Failed with the same issue. Added c:\imagemagick to the %PATH% variable. Works!

I have verified that c:\imagemagick is in the path and even tried copying the files to c:\PHP, still fails. Something has changed that is affecting 2, and only 2 (so far), machines. All machines are Windows 10 21H1 or Server 2019, the 2 that are failing are Windows 10 21H1.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1140
Location: Amsterdam, NL, EU

PostPosted: Sat 24 Jul '21 2:34    Post subject: Reply with quote

Could it be that you have or once had used the ImageMagick installer on the failing machines? What happens if you do run the installer? Assuming you are still using the x86 version run that one and use ďC:\Program Files (x86)\ImageMagickĒ as install directory, without adding that directory to the %PATH%.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1140
Location: Amsterdam, NL, EU

PostPosted: Sat 24 Jul '21 2:54    Post subject: Reply with quote

BTW. The ImageMagick artifacts are VS16 now. Make sure you install the latest vsredist, linked in the downloads section of this forum. For x86 that is https://aka.ms/vs/16/release/VC_redist.x86.exe
Back to top
nono303



Joined: 20 Dec 2016
Posts: 136
Location: Lille, FR, EU

PostPosted: Sat 24 Jul '21 11:16    Post subject: Reply with quote

Hi,
You can check arch & compiler version of both imagemagick and php (dll,exe) with this command:
Code:
dumpbin.exe /headers [filetocheck] | grep 'linker\|machine'

if all are built with vs16, linker version must be 14.2x
...and all arch must be one of x86 or x64
output like:
Code:
C:\sdk\softs\vs22\Community\VC\Tools\MSVC\14.30.30401\bin\Hostx64\x64\dumpbin.exe /headers .\php_imagick.dll | grep 'linker\|machine'
            8664 machine (x64)
           14.29 linker version
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1140
Location: Amsterdam, NL, EU

PostPosted: Sat 24 Jul '21 11:51    Post subject: Reply with quote

@laurin1 is using PHP 7.4.21, so both php.exe and php_imagick.dll are VC15. But the dependent core*.dllís and im*.dllís are VS16 now. That is no problem. See https://phpdev.toolsforresearch.com/php-7.4.21-nts-Win32-vc15-x86.htm for a loaded imagick extension with the dependencies.
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Sat 24 Jul '21 14:10    Post subject: Reply with quote

I'll try that, but I don't know how that could be the problem. We've made no changes to these in a while, 2 machines with these same exact files (I know they are the same as we put both c:\PHP and c:\imagemagick in in a Git repo, 2 still work (well, many more than that, but I can confirm 2), and 2 now fail. I've copied these files to a brand new VM, as long as c:\imagemagick is in the PATH, these same files work.
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Sat 24 Jul '21 14:22    Post subject: Reply with quote

Both php.exe and php_imagick.dll are:

8664
14.16
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1140
Location: Amsterdam, NL, EU

PostPosted: Sat 24 Jul '21 18:34    Post subject: Reply with quote

On a almost untouched Windows 10 21H1 in a Virtualbox, I tried running PHP 7.4.22RC1 with the dependent DLL's in the php-directory:
The result: https://phpdev.toolsforresearch.com/php-7.4.22RC1-nts-Win32-vc15-x86-keith.htm

You can see that the imagick extension is loaded, but it reports no supported formats.
I had to run https://phpdev.toolsforresearch.com/ImageMagick-7.1.0-2-Q16-x86-dll.exe to solve this.
Even without adding the application directory to the system path the extension found 263 supported formats:
https://phpdev.toolsforresearch.com/php-7.4.22RC1-nts-Win32-vc15-x86-keith-plus-installer.htm
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1140
Location: Amsterdam, NL, EU

PostPosted: Sat 24 Jul '21 18:56    Post subject: Reply with quote

Then I did another experiment:

The result of a 'php-cgi -i':
https://phpdev.toolsforresearch.com/php-with-imagemagick-installed-in-the-imagemagick-directory.htm
See the Environment section in the phpinfo dump to view the system path.
php.ini:
Code:
[PHP]
date.timezone=UTC
extension_dir = "ext"
extension=imagick
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Sat 24 Jul '21 21:43    Post subject: Reply with quote

Thanks for doing that. Not sure what that shows us. Like I said, the files that I am using work fine on most machines, but suddenly do not work on 2 machines. I really think the issue is environmental - some supporting files are different.
Back to top
nono303



Joined: 20 Dec 2016
Posts: 136
Location: Lille, FR, EU

PostPosted: Sat 24 Jul '21 23:39    Post subject: Reply with quote

laurin1 wrote:
Thanks for doing that. Not sure what that shows us. Like I said, the files that I am using work fine on most machines, but suddenly do not work on 2 machines. I really think the issue is environmental - some supporting files are different.

If problem only occurs on some VM with same files, try to look the dependencies tree (ex. https://github.com/lucasg/Dependencies) of php_imagick.dll on each VM and you might find some differences
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Sat 24 Jul '21 23:48    Post subject: Reply with quote

Already tried that as well:

C:\PHP>deplister.exe ext\php_imagick.dll
php7.dll,OK
CORE_RL_MagickWand_.dll,OK
CORE_RL_MagickCore_.dll,OK
KERNEL32.dll,OK
VCRUNTIME140.dll,OK
api-ms-win-crt-heap-l1-1-0.dll,OK
api-ms-win-crt-string-l1-1-0.dll,OK
api-ms-win-crt-math-l1-1-0.dll,OK
api-ms-win-crt-runtime-l1-1-0.dll,OK
api-ms-win-crt-convert-l1-1-0.dll,OK
api-ms-win-crt-stdio-l1-1-0.dll,OK
api-ms-win-crt-locale-l1-1-0.dll,OK
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Sun 25 Jul '21 0:11    Post subject: Reply with quote

nono303 wrote:
laurin1 wrote:
Thanks for doing that. Not sure what that shows us. Like I said, the files that I am using work fine on most machines, but suddenly do not work on 2 machines. I really think the issue is environmental - some supporting files are different.

If problem only occurs on some VM with same files, try to look the dependencies tree (ex. https://github.com/lucasg/Dependencies) of php_imagick.dll on each VM and you might find some differences


Ok, tried that dependency walker, and as far as I can tell, the results are identical for both machines that fail and those that don't.
Back to top
nono303



Joined: 20 Dec 2016
Posts: 136
Location: Lille, FR, EU

PostPosted: Sun 25 Jul '21 9:26    Post subject: Reply with quote

laurin1 wrote:

Ok, tried that dependency walker, and as far as I can tell, the results are identical for both machines that fail and those that don't.


Sad
I suppose that you don't have any useful information in event log or dump in WER\ReportQueue to be analyzed?
Can you launch with procdump on failing VM like this?
Code:
procdump -e 1 -x C:\dumps "C:\php\php.exe" -m

It might create a dumpfile of the raised exception in C:\dumps that can be analyzed in a debugger
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Sun 25 Jul '21 13:25    Post subject: Reply with quote

Nope.

C:\windows\system32>procdump -e 1 -x C:\temp "C:\php\php.exe" -cC:/php/devrc/php.ini -m

ProcDump v10.0 - Sysinternals process dump utility
Copyright (C) 2009-2020 Mark Russinovich and Andrew Richards
Sysinternals - www.sysinternals.com

Process: php.exe (1660)
CPU threshold: n/a
Performance counter: n/a
Commit threshold: n/a
Threshold seconds: n/a
Hung window check: Disabled
Log debug strings: Disabled
Exception monitor: First Chance+Unhandled
Exception filter: [Includes]
*
[Excludes]
Terminate monitor: Disabled
Cloning type: Disabled
Concurrent limit: n/a
Avoid outage: n/a
Number of dumps: 1
Dump folder: C:\temp\
Dump filename/mask: PROCESSNAME_YYMMDD_HHMMSS
Queue to WER: Disabled
Kill after dump: Disabled


Press Ctrl-C to end monitoring without terminating the process.


Warning: PHP Startup: Unable to load dynamic library 'imagick' (tried: ext\imagick (The specified module could not be found.), ext\php_imagick.dll (The specified module could not be found.)) in Unknown on line 0
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
imap
json
ldap
libxml
mbstring
memcache
mysqli
mysqlnd
odbc
openssl
pcre
PDO
pdo_mysql
Phar
readline
Reflection
session
SimpleXML
soap
SPL
sqlsrv
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

[06:25:09] The process has exited.
[06:25:09] Dump count not reached.
Back to top
puertoblack2003



Joined: 31 Jul 2009
Posts: 99

PostPosted: Mon 26 Jul '21 15:30    Post subject: Reply with quote

currently on php 7.4.21 and updated imagick to 7.1.0-2 Q16 x64

https://imgur.com/a/c2gSEwR

maybe you have a bad batch?
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Mon 26 Jul '21 15:39    Post subject: Reply with quote

I'm using the exact same files on every machine - I know because both c:\imagemagick and c:\PHP are in Git repos. These have worked for years, but now those same files don't work on 2 machines. I even copied the files from a failing machine to a VM, these work fine on the VM.
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1140
Location: Amsterdam, NL, EU

PostPosted: Mon 26 Jul '21 16:34    Post subject: Reply with quote

Are there other core_*.dllís and/or im_*.dllís on the failing systems, in the path or outside of the path?
Back to top
laurin1



Joined: 26 Oct 2014
Posts: 64
Location: Flower Mound, TX

PostPosted: Mon 26 Jul '21 20:56    Post subject: Reply with quote

Jan-E wrote:
Are there other core_*.dllís and/or im_*.dllís on the failing systems, in the path or outside of the path?


No. I've scanned the whole system, thinking the same thing, but nothing.
Back to top


Reply to topic   Topic: php_imagick problems (Windows, php 7.4.21) View previous topic :: View next topic
Post new topic   Forum Index -> Other Software Page 1, 2  Next