how to install imagemagick on Magic ( Xampp)

Asked

Viewed 415 times

1

I was trying to install the imagemagick on the mac, I opened the terminal and ran 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 restarted apache

Location of the facility: /Applications/XAMPP/xamppfiles

Using:

  • PHP Version 5.6.30
  • Mac OSX El Captain

While trying 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.

  • PHP Version 5.6.30 osx el Captain

  • I don’t know what you mean by the third

  • Apache 2.0 Handler is this ?

  • Ready I edited the question, I will not try to answer because I do not have a Mac here to be able to perform all tests, but in the office I have one, if no one answer until Monday I answer ;)

  • anyone has any suggestions?

1 answer

0

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

Install imagemagick if not installed:

brew install imagemagick

Installing imagemagick 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 php -m to view the list of loaded modules.

Important

Be aware that the command it contains 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 by using Brew command itself.

Can do that:

brew list php

Alternatively try this if the previous one does not return results:

brew search php

In the OSX (mac) environment, PHP is usually named in conjunction with the version. Example, if it is version 5.4.anything_, 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 what the correct name is, then apply it to the installation command.

Alternatively can install directly from sources. But it is a task that requires many details and can generate 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

Execute:

To install the Imagick:

./pecl install imagick

After that, make sure that php.ini has added the extension correctly. There must 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 that, restart Apache and check on phpinfo() if uploaded to library.

If you still can’t, you can try to install XAMP-independent PEAR/PECL.

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

From there follow the above instructions, checking Imagick.so in php.ini and restarting Apache.

  • ./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 now returns this when typing. /pecl install Imagick

  • The message says to grant appropriate permissions for reading and writing in that given directory. To uncomplicate, just give one chmod -R 0777 /tmp

  • problem remains. I’ll add detail to the question

  • php.ini found where? and what to put inside?

  • I tried to put "Extension=Imagick.so" in php.ini and restarted apache but it won’t resolve.

  • I cannot comment on anything because I am oblivious to what you are doing. I could try to help if you had followed the guidelines. One problem is that by not following the steps described in the answer, you may have created 2 or more different php installations on your system and may even be editing an invalid php.ini. There are many reasons, making any help unfeasible to respond under the scope of the site SO-pt. You will have to solve alone or hire a professional. Another way is to wait for good luck so that some professional will work for free to solve your work. Good luck.. will need.

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.