sajad torkamani

Make sure the extension is installed

Run pecl install <ext-name>. See How to install PHP extensions with PECL for more info.

Usually, this should modify one of your PHP.ini files to add a line like the below:

extension="imagick.so"

But if for whatever reason this didn’t happen, read on!

Enable the extension in PHP .ini file

Find a PHP .ini file that’s loaded by your system’s PHP (See List configuration files loaded by PHP), then open it and look for a section that lists a bunch of extensions like:

;extension=curl
;extension=ffi
;extension=ftp
;extension=fileinfo
;etc.

Add a line for your extension and make sure it’s not commented by removing the ; from the start of the line.

Restart PHP

Restart your web server or PHP-FPM for the PHP.ini change to take effect.

With homebrew on macOS, something like bre services restart php should do the trick.

On Linux, you’ll want to use systemctl or something similar.

Leave a comment

Your email address will not be published. Required fields are marked *