Recently while I was setting up Nuno Maduro's Pinkary project in my local PC I had a hardtime. I had many reasons but especially with installing Imagick PHP extension.
I was using XAMPP as my local server but when I tried to install this app there was multiple problems like PHP version etc. So I chose to use Docker but for that also PHP8.3 was needed and these PHP extensions are also needed. So you can use these steps for prettymuch all PHP extension installations.
Before you begin, ensure you know your PHP version, thread safety (TS or NTS), and architecture (x86 or x64). You can find this information by running the following command in your command prompt:
php -i | findstr "Thread Safety" && php -i | findstr "Architecture" && php -v
php_imagick.dll
file from the extracted
folder and paste it into your PHP extensions directory (e.g.,
C:\xampp\php\ext
).
C:\xampp\php
).
php.ini
File
Open your php.ini
file (usually located in your PHP
installation directory) and add the following line to enable the Imagick
extension:
extension=php_imagick.dll
Path
variable and click Edit.
C:\xampp\php\php_imagick-3-7-0
).
Open the XAMPP control panel (or your web server control panel) and restart Apache to apply the changes.
Create a PHP file (e.g., info.php) with the following content:
<?php phpinfo(); ?>
Open this file in your browser (e.g.,
http://localhost/info.php
) and search for
"imagick" to verify that the extension is loaded.
Hope it is done. And I believe we can follow these steps to install any new PHP extensions.
Happy coding! 🚀