how to install imagemagick on macintosh (Xampp)

1

I was trying to install imagemagick on the mac, I opened the terminal and executed the following command

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)".

Then I checked

brew install imagemagick

brew install php56-imagick

But when I open php info nothing appears about it

I also tried the terminal

php -m

But it also does not appear and I restarted apache

Location of installation: /Applications/XAMPP/xamppfiles

Using:

  • PHP Version 5.6.30
  • Mac OSX The captain

When you try this:

cd /Applications/XAMPP/xamppfiles/bin
chmod -R 0777 /tmp
./pecl install imagick
  

WARNING: configuration download directory "/ tmp / pear / install" is not   writeable. Change download_dir config variable to a writeable dir to   avoid this warning WARNING: channel "pecl.php.net" has updated its   protocols, use "pecl channel-update pecl.php.net" to update   downloading imagick-3.4.3.tgz ... Starting to download   imagick-3.4.3.tgz (245,410 bytes)   .................................................. .done: 245,410 bytes   ERROR: failed to mkdir / tmp / pear / install / imagick.

    
asked by anonymous 06.05.2017 / 23:10

1 answer

0

If you have Homebrew, run this in the console command:

Install the imagemagick if it is not installed:

brew install imagemagick

The imagemagick installation DOES NOT INCLUDE the library for PHP. Therefore, install the PHP-specific library.

brew install php-imagick

Restart Apache and run phpinfo() or, on the console, run php -m to see the list of modules loaded.

Important

Please be aware that the command containing php-imagick may have another nomenclature, for example, php5-imagick . It depends on how PHP is installed in your environment. A practical way to know the name of the PHP package is to use the brew command itself.

You can do this:

brew list php

Alternatively try this if the above does not return results:

brew search php

In the OSX (Mac) environment, PHP is usually named together with the version. For example, if it is version 5.4.any_ thing, it is likely to be php54. So the command to install the library would look like this:

brew install php54-imagick

Obviously, this is just an example. Before invoking the installation, make sure it is the correct name, then apply it to the installation command.

Alternatively you can install direct from the sources. But it is a task that requires a lot of detail and can create problems with conflicts between libraries and dependencies. A package manager like Homebrew simplifies this work.

Installing via PEAR / PECL

If the XAMP package has the pecl binary, go to the directory:

cd /Applications/XAMPP/xamppfiles/bin

Run:

To install imagick:

./pecl install imagick

After this, make sure that php.ini has been added to the extension correctly. There should be something like this:

extension=imagick.so

If not, add manually. But obviously, the imagick.so file must exist, otherwise apache might not start.

After this, restart Apache and check the% s of% if you loaded the library.

If you still can not, you can try to install PEAR / PECL independent of XAMP.

> wget http://pear.php.net/go-pear.phar
> php go-pear.phar
> pecl install imagick

From here follow the instructions above, checking the imagick.so in php.ini and restarting Apache.

    
07.05.2017 / 08:40