Unable to install php imagick - php

I'm trying to install Imagick as its required for an extension I want to use for my project.
I've tried to install it on my ArchLinux like:
pacman -S imagemagick
pecl install imagick
The pecl install ends up throwing me the following error:
checking ImageMagick MagickWand API configuration program... checking Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... It exists
found in /usr/bin/MagickWand-config
checking if ImageMagick version is at least 6.2.4... found version 7.0.7 Q16 HDRI
checking for MagickWand.h or magick-wand.h header... configure: error: Unable to find MagickWand.h or magick-wand.h header
ERROR: `/tmp/pear/temp/imagick/configure --with-php-config=/usr/bin/php-config --with-imagick' failed
Any help as to how to get Imagick installed on my ArchLinux would be great.
Thanks in advance!

Related

PHP extension imagick 3.5.0 for PHP 8 : installation on macos fails

When I try to run the following command
pecl install imagick
Then the installation end up with:
imagemagick/7.0.11-9/lib -L/usr/local/Cellar/imagemagick/7.0.11-9/lib -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/imagick.so -bundle .libs/imagick_file.o .libs/imagick_class.o .libs/imagickdraw_class.o .libs/imagickpixel_class.o .libs/imagickpixeliterator_class.o .libs/imagick_helpers.o .libs/imagick.o .libs/imagickkernel_class.o .libs/shim_im6_to_im7.o -lgomp -L/usr/local/Cellar/imagemagick/7.0.11-9/lib /usr/local/Cellar/imagemagick/7.0.11-9/lib/libMagickWand-7.Q16HDRI.dylib -L/usr/local/Cellar/little-cms2/2.12/lib -L/usr/local/opt/freetype/lib -L/usr/local/Cellar/glib/2.68.1/lib -L/usr/local/opt/gettext/lib /usr/local/Cellar/imagemagick/7.0.11-9/lib/libMagickCore-7.Q16HDRI.dylib -Wl,-rpath -Wl,/usr/local/Cellar/imagemagick/7.0.11-9/lib
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [imagick.la] Error 1
ERROR: `make' failed
The reason seems to be that the compilation of the last version of imagick (3.5.0) has changes that require this library. It's impossible to install a lower version because they are not compatible with PHP 8.0.
Any idea how to get rid of this error on macos?
Update 22 July 2021
As of 22 July 2021, version 3.5.1 is stable in the pecl channel and can be used to compile imagick for both PHP 7 and PHP 8.
pecl install imagick
The general command will not fail anymore
Old Answer
Version 3.5 currently can't compile on MAC because of missing/broken support for gomp of the MAC gcc compiler.
Best fix is to install version 3.4.4
pecl install imagick-3.4.4
More info here
There is a fix for this issue by manually installing the extension. The only issue with it is that it does not appear in the pecl installed extensions after the installation is done and can't be uninstalled from pecl. Nonetheless I'm providing the answer I found here:
Run the following commands
cd path/to/installation/is/going/to/be/made
pecl bundle imagick
cd imagick
mv config.m4 config.m4.bak
wget https://raw.githubusercontent.com/yyongpil/imagick/2a2b924b9d25c8ef4a677b72e6868fbc7c9e01cc/config.m4
To explain the previous process command line by command line:
Place yourself in the folder where you are going to make the install
Download and expand the source files
Enter the source folder
Backup the original config.m4 file for safety purposes
Download modified config.m4 file to fix gomp issue as explained here
And finally simply continue with the manual installation process
phpize
./configuration
make
sudo make install
After this, you should be good to go to use the latest imagick extension for PHP. For PHP 8.0 and imagick 3.5.0 the so file is located at /usr/local/lib/php/pecl/20200930/imagick.so
A new version has been tag and contains the build configuration fixed! You can install it with this command:
pecl install imagick-3.5.1
(without the version it should now work)

How to install PHP extension using PECL (with Homebrew)

I try to install amqp php extension on my mac using brew.
Enviroment: MacOS Catalina 10.15.6,
Homebrew 2.5.0, PHP 7.4.10, rabbitmq 3.8.8, rabbitmq-c 0.10.0
I got following messages after executing: pecl install amqp
checking for pkg-config... /usr/local/bin/pkg-config
checking for amqp using pkg-config... configure: error: librabbitmq not found
ERROR: `/private/tmp/pear/temp/amqp/configure --with-php-config=/usr/local/opt/php/bin/php-config --with-librabbitmq-dir' failed
Any ideas how to solve this problem.
For anyone with similar problem.
For the question:
Set the path to librabbitmq install prefix [autodetect] :
do not leave empty answer (autodetect).
In my case, setting this value to
/usr/local/Cellar/rabbitmq-c/0.10.0
do the job.

Error: install Mustache PHP Extension error

When I install "mustache" PHP extension with "pecl install mustache" command I get a error like "configure: error: libmustache not found" .
My PHP version is : PHP Version 7.2.11
My Mac version is : High Sierra (10.13.6)
[Error Detail is here][1]
`checking for libmustache files... configure: error: libmustache not
found
ERROR: `/private/tmp/pear/temp/mustache/configure --with-php-
config=/usr/local/opt/php/bin/php-config' failed`
You are trying to install a php extension, but you are missing the underlying library. Install libmustache first, with (as it seems you are on macOS):
brew install libmustache
See https://github.com/jbboehr/libmustache for reference

How do I install PHP with openssl on Mac High Sierra?

I'm using Mac High Sierra. I want to install PHP 7.2 with the openssl extension. I have openssl installed
localhost:php-7.2.1 davea$ brew install openssl
Warning: openssl 1.0.2n is already installed
However, when I run the PHP configure command (I'm building it from source), it eventually dies with the below error
localhost:php-7.2.1 davea$ ./configure --with-gmp=/usr/local --with-openssl --with-openssl-dir=/opt/local/bin
...
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for RAND_egd... no
checking for pkg-config... /usr/local/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
How do I tell PHP where that library is or rather how do I install it somewhere on my Mac?
ps - The reason I'm not installing PHP with homebrew is because homebrew does not support installation of PHP with GMP, which I need.

gnupg for PHP on OSX

I'm trying to set up gnupg for use in PHP on my mac.
I have tried following the directions found at the following links:
http://measure9.varkel.net/2013/10/building-gnupg-for-php-5-5-on-osx/
Install PHP gnupg using PECL on MAC/MAMP 10.8.4
What I seem to be running into with both is this message:
checking for gpgme_check_version in -lgpgme... no
configure: error: wrong gpgme lib version or lib not found
I see this when executing the './configure' command.
I have installed gpgme using Homebrew.
I'm a bit stuck as I've tried everything I can come up with and haven't had any luck.
I am running PHP 5.6.7 on OSX 10.10.2 using MAMP Pro.
Thank you in advance for any help you can provide.
EDIT:
My original question was unclear, so I'll try again.
I am trying to install gnupg for use in PHP in my dev environment, which is a macbook using MAMP.
I fist installed gpgme and gnpug using Homebrew, both with no issues.
Then I attempted to install gnupg using pecl via the following command
sudo pecl install gnupg
And I end up with this error message
configure: error: wrong gpgme lib version or lib not found
ERROR: `/private/tmp/pear/install/gnupg/configure' failed
I have tried editing my path with no success, adding usr/local/include and usr/local/lib, where gpgme.h and libgpgme.a files can be found. I see no change in the error message.
EDIT 2:
I believe that gpgme is being installed correctly and pecl is able to find it. I install it using the following command
brew install gpgme
If I then run the pecl command to install gnupg, I get the error message above.
Now, if I execute the brew command to uninstall gpgme
brew uninstall gpgme
I see the following error message when trying to install gnupg with pecl
configure: error: Please reinstall the gpgme distribution
ERROR: `/private/tmp/pear/temp/gnupg/configure' failed
which seems to indicate that the library is installing and being found, but it's an incorrect version.
I am unable to find any information on what version is required for pecl to install gnupg.
EDIT 3:
Looking at the terminal a little more, I see that it's failing to find a specific function (gpgme_check_version) in the lib file.
checking for gpgme_check_version in -lgpgme... no
configure: error: wrong gpgme lib version or lib not found
ERROR: `/private/tmp/pear/temp/gnupg/configure' failed
I'm not entirely sure what happened, but I believe my installation of autoconf was somehow compromised.
What ended up solving my problem was using brew to uninstall autoconf and gpgme, then using brew to reinstall both packages.

Categories