It appears ImageMagick and ImageMagick-devel are removed from RHEL 8.
I have added 3rd party repositories such as EPEL, REMI, & RPMFusion.
I am able to install the GraphicsMagick replacement for Imagemagick but it appears Gmagick is not compatible with ImageMagick at PHP library code level.
So the below method does not help... for the plugin I am using which depends on PHP Imagemagick, while using Gmagick to convert something in the CLI it will work.
$ dnf install GraphicsMagick GraphicsMagick-devel GraphicsMagick-perl ghostscript
$ cd /usr/local/src
$ wget https://pecl.php.net/get/gmagick
$ tar xfvz gmagick $ cd gmagick-*
$ phpize
$ ./configure
$ make
$ make installl
$ php --ini | grep 'Loaded Configuration File'
$ nano /etc/php.ini
// add extension to end of php.ini
extension=gmagick.so
When trying to install ImageMagick
$ sudo yum install ImageMagick-devel
No match for argument: ImageMagick-deval
Error: Unable to find a match: ImageMagick-deval
$ pecl install imagick
checking whether to enable the imagick extension... yes, shared
checking for pkg-config... /bin/pkg-config
checking ImageMagick MagickWand API configuration program... checking
Testing /usr/local/bin/MagickWand-config... Doesn't exist
checking Testing /usr/bin/MagickWand-config... Doesn't exist
checking Testing /usr/sbin/bin/MagickWand-config... Doesn't exist
checking Testing /opt/bin/MagickWand-config... Doesn't exist
checking Testing /opt/local/bin/MagickWand-config... Doesn't exist
configure: error: not found. Please provide a path to MagickWand-config
or Wand-config program.
ERROR: `/var/tmp/imagick/configure --with-php-config=/bin/php-config
--with-imagick' failed
Is there a way to manually get ImageMagick, ImageMagick-devel and PECL Imagick installed on RHEL 8 (NOT Gmagick)
EDIT
# dnf repolist
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:00:17 ago on Fri 28 Feb 2020 20:58:19 UTC.
repo id repo name status
*epel Extra Packages for Enterprise Linux 8 - x86_64 4,916
*epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 0
remi-modular Remi's Modular repository for Enterprise Linux 8 - x86_64 16
remi-safe Safe Remi's RPM repository for Enterprise Linux 8 - x86_64 2,133
rhel-8-appstream-rhui-rpms Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs) 8,566
rhel-8-baseos-rhui-rpms Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs) 3,690
rhui-client-config-server-8 Red Hat Update Infrastructure 3 Client Configuration Server 8 6
rpmfusion-free-updates RPM Fusion for EL 8 - Free - Updates
# yum install ImageMagick-devel
Error:
Problem: conflicting requests
- nothing provides jasper-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
- nothing provides OpenEXR-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
- nothing provides ghostscript-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
- nothing provides lcms2-devel needed by ImageMagick-devel-6.9.10.86-1.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
SOLVED - https://www.imagemagick.org/script/install-source.php#unix
$ cd ImageMagick-7.0.9-26
$ ./configure
$ make
$ make install
$ sudo ldconfig /usr/local/lib
$ pecl install imagick
$ nano /etc/php.ini
// Add the following
extension=imagick.so
Works after removing Gmagick
Clean try with
$ sudo dnf install ImageMagick
$ dnf install php73-php-pecl-imagick
# php --ini | grep 'Loaded Configuration File'
PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/lib64/php/modules/imagick.so (/usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imagick.so.so (/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Loaded Configuration File: /etc/php.ini
# ls
bz2.so curl.so fileinfo.so gettext.so json.so mysqli.so pdo_mysql.so phar.so simplexml.so sysvmsg.so tokenizer.so xml.so
calendar.so dom.so ftp.so iconv.so mbstring.so mysqlnd.so pdo.so posix.so sockets.so sysvsem.so wddx.so xmlwriter.so
ctype.so exif.so gd.so intl.so mcrypt.so opcache.so pdo_sqlite.so shmop.so sqlite3.so sysvshm.so xmlreader.so xsl.so
nothing shown in php -m for imagick
# php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/lib64/php/modules/imagick.so (/usr/lib64/php/modules/imagick.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imagick.so.so (/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.3.5 (cli) (built: Apr 30 2019 08:37:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.5, Copyright (c) 1999-2018, by Zend Technologies
It looks like you seek to install PHP imagick module while having Remi repos around. So why not install directly the packaged module in lieu of compiling it?
Instead of pecl install imagick you can do something like dnf install php74-php-pecl-imagick. The actual command depends on whether you want multiple PHP versions or replace the default one, use config wizard for a hint.
Then you will not need any -devel packages installed.
If for some reason you don't want to rely on a packaged install the PHP module and really want to compile, you need to enable CodeReady Builder repo:
sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-*-rpms"
CENTOS 8
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y
dnf install GraphicsMagick
Related
Has anyone come across this warning before? Any files I should check other than php.ini or 00-ioncube.ini? Those look to be in good order.
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/lib64/php/modules/imagick.so (libMagickWand.so.5: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/imagick.so.so (/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.3.31 (cli) (built: Sep 21 2021 10:24:03) ( NTS )
Operating System:
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.42.2.el7.x86_64
Architecture: x86-64
I upgraded PHP from version 7.1 to 7.3 on using these steps:
php -v
sudo yum install epel-release
yum --enablerepo=remi-php73 install php
php -v
systemctl restart httpd
I only see one php.ini file loaded in /etc/
Check how was the imagick extension was installed:
rpm -qf /usr/lib64/php/modules/imagick.so
It looks like it is not provided by a RPM, nor built for the proper PHP version you are running (libMagickWand.so.5 is also an old version).
For a proper configuration / installation, see the Wizard instructions
At least I recommend you enable the remi-php73 repository permanently, to ensure all extensions are taken from it.
yum-config-manager --enable remi-php73
Then you can install the imagick extension, or any other extension you need
yum install php-imagick
Notice, in this repository you have the choice between 2 variants of this extension, above command will pick one among:
php-pecl-imagick-im6 build with ImageMagick version 6 (libMagickCore-6.Q16.so.7, libMagickWand-6.Q16.so.7)
php-pecl-imagick-im7 build with ImageMagick version 7 (libMagickCore-7.Q16HDRI.so.10, libMagickWand-7.Q16HDRI.so.10)
APIs are slightly different.
I've followed these steps to install imagemagick and php extension imagick in my computer with Mac OS Catalina and I can't seem to find a way.
I always get the following error when trying to install imagick with $ sudo pecl install imagick:
php_imagick.h:42:10: fatal error: 'php.h' file not found
#include "php.h"
^~~~~~~
1 error generated.
make: *** [imagick_file.lo] Error 1
ERROR: `make' failed
I'm using php.7.3.11.
Apparently Mac OS X Catalina decided to move the headers to another folder and now it doesn't seem to find them.
I've been reading this answer but seems like the solution is too long to be true. Isn't there any other more simple and straight forward method?
It seems others manage to fix it for other extensions with much less trouble.
However, I'm not quite sure the steps for Imagick are exactly the same...
I had this same issue with my new MacBook Air and Catalina. It was a because I did not have PHP installed with brew. I looked at the page you linked to, and I am assuming you have already completed the brew install pkg-config imagemagick. This is what I would do to get clean it up and get it working, see below.
Remove your existing imagemagick and pkg-config that were just installed (and PHP if it shows up in the versions list)
First, we get the php #ver name if necessary. If you don't see PHP in the list then we don't need to remove it, just remove the other two.
brew list --versions
...
imagemagick 7.0.10-0
...
pcre 8.44
php#7.3 7.3.16
pkg-config 0.29.2_2
...
Stop the php service if it is running, in my case it is #7.3
brew services stop php#7.3
Next we remove the items having issue
brew remove php#7.3 pkg-config imagemagick
or simply
brew remove pkg-config imagemagick if PHP not installed with brew
Restart your computer (optional, but I like to do it)
Now we install the items again, include PHP this time if it was not installed with brew last time
brew install php#7.3 pkg-config imagemagick
Add PHP to your path for cmd line if not already there (optional)
echo 'export PATH="/usr/local/opt/php#7.3/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php#7.3/sbin:$PATH"' >> ~/.bash_profile
To have launchd start php#7.3 now and restart at login:
brew services start php#7.3
Or, if you don't want/need a background service you can just run:
php-fpm
Confirm PHP and imagemagick and perl/pecl are the expected versions
php -v
PHP 7.3.16 (cli) (built: Mar 19 2020 11:19:09) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.16, Copyright (c) 1999-2018, by Zend Technologies
convert --version
Version: ImageMagick 7.0.10-0 Q16 x86_64 2020-04-04 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib freetype gslib heic jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp xml zlib
pecl version
PEAR Version: 1.10.10
PHP Version: 7.3.16
Zend Engine Version: 3.3.16
Running on: Darwin mbookair.local 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64
Now install iMagick using pecl
pecl install imagick
hit ENTER when you see the path question for 'autodetect'
When it's complete you can confirm the module is loaded
php -m | grep imagick
if it's loaded it will return one line with the word imagick
Test from command line imagick installed correctly
cd to your user home dir
cd ~
Run PHP as interactive shell from cmd line
php -a
Code to test at cmd line:
$im = new Imagick ();
$im->newImage (300, 225, "blue");
$im->writeImage ("test_imagick.jpg");
Exit php interactive mode by typing exit, then check if the bright blue test_imagick.jpg was created in your user dir
Troubleshooting Notes
If you are getting a warning about:
"PHP Warning: Module 'imagick' already loaded in Unknown on line 0
Warning: Module 'imagick' already loaded in Unknown on line 0"
This may be left over from the previous pecl install that did not complete. Check your php.ini file and remove duplicate extension="imagick.so" entry
There is a bug in home brew, here is the link
https://github.com/Homebrew/homebrew-core/issues/41081
When you get tired of home brew, switch to Ubuntu, install imagick no fuss package installation.
I'm using the ondrej ppa for PHP and am running Ubuntu 18. Running php -v gives me the following output:
PHP Warning: PHP Startup: Unable to load dynamic library 'curl.so' (tried: /usr/lib/php/20190902/curl.so (/usr/lib/php/20190902/curl.so: symbol curl_mime_addpart version CURL_OPENSSL_4 not defined in file libcurl.so.4 with link time reference), /usr/lib/php/20190902/curl.so.so (/usr/lib/php/20190902/curl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.4.2 (cli) (built: Jan 23 2020 11:21:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.2, Copyright (c), by Zend Technologies
Basically, I can't run any composer commands because a lot of libraries depend on curl, and apparently it isn't being found. I've done the following:
Tried to update everything (sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get install php7.4-curl). This doesn't fix the issue.
Restarted apache despite this being the cli version.
Double checked where it's trying to find the library. What's weird is that /usr/lib/php/20190902/curl.so is a valid path and the file is definitely there.
Running php --ini also shows that the curl extension is loaded:
Configuration File (php.ini) Path: /etc/php/7.4/cli
Loaded Configuration File: /etc/php/7.4/cli/php.ini
Scan for additional .ini files in: /etc/php/7.4/cli/conf.d
Additional .ini files parsed: /etc/php/7.4/cli/conf.d/10-mysqlnd.ini,
...more ini files...
/etc/php/7.4/cli/conf.d/20-curl.ini,
...more ini files...
I'm unsure how to fix this as the file it supposedly can not find is exactly where it says it looked, and everything is up to date.
For anyone with this issue, the answer is here.
Basically, the libcurl that was installed on my Ubuntu machine clashed with the official one that Ubuntu has? Weirdly it was only affecting php7.3 and 7.4 and not 7.2. Anyways, I renamed the libcurl module like so:
mv /usr/local/lib/libcurl.so.4.4.0 /usr/local/lib/libcurl.so.4.4.0.backup
And by running php -m, I could verify that the cURL module was now enabled.
I found that if I did:
apt search | more
(the pipe is for long lists)
that I could find the php package name that I needed.
For example:
apt search curl
told me that the name of the package for my php version is 'php7.2-curl'
So, all I had to do was sudo apt install php7.2 curl.
I repeated this (some names require a little googling, and/or some apt search creativity.
I solved it by doing this:
Uninstall curl:
apt remove php7.4-curl
New install:
apt install php7.4-curl
I have now all right.
After trying to run composer update things were failing because the deps where from php -v 7 while I was using 8.
composer install --ignore-platform-reqs
worked for me
I'm trying to install Magento (2.3.0) on macOS Mojave. Magento shows PHP Extension intl. is missing.
I tried the below to resolve:
Made a copy of php.ini using cp /etc/php.ini.default php.ini
Removed ";" before extension=php_intl.dll
Restart Apache sudo apachectl restart
But the above did not resolve.
On checking php -v, i'm seeing the below error:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20160303/php_intl.dll' -
dlopen(/usr/lib/php/extensions/no-debug-non-zts-20160303/php_intl.dll,
0x0009): dlopen(): file not found: /usr/lib/php/extensions/no-debug-
non-zts-20160303/php_intl.dll in Unknown on line 0
PHP 7.1.19 (cli) (built: Aug 17 2018 20:10:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
There are only 2 files under /usr/lib/php/extensions/no-debug-non-zts-20160303 namely opache.so and xdebug.so
How can i install or enable "PHP Extension intl" on my macOS Mojave?
Here's a solution that worked for me:
Find all PHP versions installed brew list | grep php
Remove all versions of PHP brew remove --ignore-dependencies --force php70 php71 php72 (based on what you see above)
Install PHP brew install php72 (i chose 7.2, 7.3 is not supported yet by several vendors)
Run the command which php should show you the path to the installed PHP. Copy the path.
Update your bash_profile vi ~/.bash_profile and add this line to the file:
export PATH=/usr/local/php5/bin:$PATH
Save and run this source ~/.bash_profile
Check if PHP Intl Extension is installed using php -m | grep intl. If the installation went well, we will see intl listed. If not the extension is not installed.
I think from PHP 7 (not sure of the version), the extensions are available by default and we need not enable them in php.ini file explicitly.
If you installed Homebrew's php, linking it to a directory in your path will fix the issue.
brew link --force php#7.3
I had the same issue and that fixed it.
Here is a link where I got a detailed answer from
Got help from the link and able to compile https://donatstudios.com/Install-PHP-Mcrypt-Extension-in-OS-X
Next we will download the PHP source. Verify the exact version of PHP you are running. This can be retrieved as follows. The version is highlighted.
$ php --version
PHP 7.1.19 (cli) (built: Aug 17 2018 18:03:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Now we move into a working directory and download the source making sure to update the following for the version from above.
$ cd /tmp
$ curl -L http://php.net/get/php-{{php-version}}.tar.bz2/from/this/mirror > php.tar.bz2
$ open php.tar.bz2
Now we will compile and test the extension.
$ cd php-{{php-version}}/ext/{{extension}}
$ phpize
$ ./configure
$ make
$ make test
$ sudo make install
If all that goes well finally we'll need to add the following to our php.ini - I usually add at it at the end of the file.
extension = {{extension}}
.so
You can verify your installation with the following:
$ php --info | grep {{extension}}\\.
Lastly, depending on your setup now you may want to restart apache.
$ sudo apachectl restart
I'm new to server and linux and I ran into some problems. I'm trying to update my PHP by looking for linux commands through the net. Some commands ran perfectly but some not.
I tried using this command to install php-gd since I have this error message 'Required GD library is missing'. So, I tried to run this below:
yum install php-gd
However, it give me this error message below:
php56w-common conflicts with php-common-5.3.3-46.el6_6.x86_64
Here are some info on my server:
[root#uat ~]# rpm -ql php
package php is not installed
[root#uat ~]# rpm -qa php\*
php56w-pdo-5.6.11-1.w6.x86_64
php56w-5.6.11-1.w6.x86_64
php56w-cli-5.6.11-1.w6.x86_64
php56w-common-5.6.11-1.w6.x86_64
php56w-mysql-5.6.11-1.w6.x86_64
[root#uat ~]# rpm -Va php\*
S.5....T. c /etc/php.ini
[root#uat ~]# which php
/usr/bin/php
[root#uat ~]# php -v
PHP 5.6.11 (cli) (built: Jul 10 2015 22:43:20)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
Do you know what have I done wrong upgrading my php? Should I remove all php files on my server and reinstall? How?
Solved it by removing all php using "yum remove php php-common"
and modified the filename "remi.repo" under the folder /etc/yum.repos.d like below:
[remi-php56]
name=Remi's PHP 5.6 RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/php56/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/php56/mirror
# WARNING: If you enable this repository, you must also enable "remi"
enabled=1
gpgcheck=1
making sure that php56 is enabled=1.
You should run:
yum install php56w-gd
So when install php-extension have error:
*-common conflicts with php-common-5.3.3-46.el6_6.x86_64
Just type *-extension
Example:
yum install php-fpm have error
Error: php56u-common conflicts with php-common-5.3.3-46.el6_7.1.x86_64
then you should run
yum install php56u-fpm
The reason of this error is you install a php version don't match the system repo version. So yum get a version of the system repo, but this don't compatible with the php version you have installed. When you specific the php version, yum get the right version, so happy!
Go to /etc/yum.repos.d.
Remove the extra repository that you can see in your complete error message.
Nima
If you are using Centos 6.7 and have php 5.6 installed, the following command worked for me:
sudo yum install php56w-pecl-xdebug.x86_64 (I was installing xdebug, not GD)
I found this by running yum search php56