Issue Summary
WP CLI and Composer display PHP extension error messages for the php_imagick.dll
extension. This happens after clicking “Open Site Shell” or running commands, such as wp cli version
or composer --version
.
Weirdly enough, C:\Users\Hannah\AppData\Roaming\Local\lightning-services\php-7.4.1+16\bin\win64\ext\php_imagick.dll
exists at the searched path.
Troubleshooting Questions
Does this happen for all sites in Local, or just one in particular?
- This is only happening to sites using PHP 7.4.1, not PHP 7.3.5.
Are you able to create a new, plain WordPress site in Local and access it in a Browser?
- Yes.
Replication
- Create new local site.
- Set PHP version to 7.3.5.
- Start the site.
- Right-click on the site and select “Open Site Shell”.
- Notice no PHP errors.
- Select PHP version 7.4.1 and click APPLY.
- Right-click on the site and select “Open Site Shell”.
- Notice below WP CLI and PHP errors.
WP-CLI: Warning: PHP Startup: Unable to load dynamic library 'php_imagick.dll' (tried: C:/Users/Hannah/AppData/Roaming/Local/lightning-services/php-7.4.1+16/bin/win64/ext\php_imagick.dll (The specified module could not be found.), C:/Users/Hannah/AppData/Roaming/Local/lightning-services/php-7.4.1+16/bin/win64/ext\php_php_imagick.dll.dll (The specified module could not be found.)) in Unknown on line 0
WP-CLI: WP-CLI 2.5.0-alpha
// ...
Composer: Composer version 1.10.8 2020-06-24 21:23:30
PHP: Warning: PHP Startup: Unable to load dynamic library 'php_imagick.dll' (tried: C:/Users/Hannah/AppData/Roaming/Local/lightning-services/php-7.4.1+16/bin/win64/ext\php_imagick.dll (The specified module could not be found.), C:/Users/Hannah/AppData/Roaming/Local/lightning-services/php-7.4.1+16/bin/win64/ext\php_php_imagick.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP: 7.4.1
MySQL: mysql Ver 8.0.16 for Win64 on x86_64 (MySQL Community Server - GPL)
System Details
Which version of Local is being used?
- Local 6.0.0+5444
What Operating System (OS) and OS version is being used?
- Microsoft Office 10 (10.0.19041 Build 19041)
Attach the Local Log. See this Community Forum post for instructions on how to do so:
- Unfortunately, no log was created by this error.
Similar Issues
- WP-CLI warnings with PHP 7.4.1 on Windows 10
- PHP Startup: Unable to load dynamic library ‘php_imagick.dll’
Already tried
Stopped and restarted Local after each change.
- I tried adding
extension=php_imagick.dll
to the{{#if os.windows}}
block inE:\PROJECTS\local-sites\testagain\conf\php\php.ini.hbs
file, but the errors persist.- This also caused an error on the Overview dashboard: “
Warning: Module 'imagick' already loaded in Unknown on line 05.7.2
”.
- This also caused an error on the Overview dashboard: “
- Adding
C:\Users\Hannah\AppData\Roaming\Local\lightning-services\php-7.4.1+16\bin\win64
to the system PATH did not help either. Even restarted the computer for good measure.