I recently switched to macOS and started a simple project that will require me to use the Imagick extension. I’m trying to install Imagick using Homebrew but encountered an error during installation.
I already executed the following command.
pecl install imagick
git clone https://github.com/Imagick/imagick
cd imagick
phpize && ./configure
make
make install
However, I’m encountering an error on make install command.
mkdir: /opt/homebrew/Cellar/php/8.3.8/pecl: File exists
mkdir: /opt/homebrew/Cellar/php/8.3.8/pecl: No such file or directory
make: *** [install-modules] Error 1
Also tried removing existing pecl directory and reinstalling imagick.
sudo rm -rf /opt/homebrew/Cellar/php/8.3.8/pecl
sudo mkdir -p /opt/homebrew/Cellar/php/8.3.8/pecl
pecl install imagick
But encountered this error
Build process completed successfully
Installing '/opt/homebrew/Cellar/php/8.3.8/include/php/ext/imagick/php_imagick_shared.h'
Installing '/opt/homebrew/Cellar/php/8.3.8/pecl/20230831/imagick.so'
ERROR: failed to mkdir /opt/homebrew/Cellar/php/8.3.8/pecl/20230831
I tried searching for the same error but couldn’t find any.
How to fix this issue? How do I find this directory on my mac(still familiarizing myself with apple ecosystem)?
Haru is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.