Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

tobinguyen's avatar

How do I ensure all dependencies are installed for PHP extensions on MacOS?

Hi guys. I cloned a repo to try it out and got an error about the missing ext-imagick extension. I have installed it successfully, but I’m curious about how to find the full instructions for installing a PHP extension on MacOS. For example, with ext-imagick, after running pecl install imagick, I got errors about missing some ImageMagick MagickWand API configs. After some research, I found out that I needed to install it with brew install imagemagick first. So, for other extensions, how do I know if I need to install something else first? I’m still new to macOS. Thanks, and have a nice day!

0 likes
3 replies
vincent15000's avatar

I don't use MacOS, but I'm quite sure that you only had to install the package with brew.

1 like
jdc1898's avatar

PHP -m will show you your modules. You can use PECL to install additional ones.

1 like
tobinguyen's avatar

@vincent15000 @jdc1898 I know I can use brew and pecl, but I’m wondering how to figure out that I need to install dependencies first. For example, in my case, I tried pecl install imagick, but it failed. After some digging, I found someone on StackOverflow who mentioned that I needed to run brew install imagemagick first. So, how can I know there’s a dependency named imagemagick that needs to be installed first?

Please or to participate in this conversation.