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.
Related
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
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 am having problems getting October CMS to update:
Update failed
"Class 'ZipArchive' not found" on line 51 of /var/www/html/jdd/htdocs/vendor/october/rain/src/Filesystem/Zip.php
And if I do php -m, i get the following warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: undefined symbol: zip_libzip_version), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Strange thing is, in my /etc/php.d/ folder, the zip.ini file contains the line: extension=zip.so. whereas all other .ini files in /php.d do not include the ".so" extension (eg: for the json.ini file, the line reads: extension=json). I have tried removing the ".so" from the zip.ini extension= line, but it still won't work.
As far as I know, the system is only running x86_64 executables (how do I check this with absolute certainty - all binaries are showing as .x86_64 or .noarch?).
I have tried other versions of php:
-php 5.4 installs zip.so fine (it loads correctly), except October requires at least php 7.0.
-php 7.0 to 7.3 all install zip.so, but the extension still does not load.
Can anyone help?
I've got the same problem and found following solution:
Search for installed php modules:
yum list installed | grep php*
Try to locate installed php-zip module:
rpm -ql php72-php-pecl-zip
You will see something like this:
/etc/opt/remi/php72/php.d/40-zip.ini
/opt/remi/php72/root/usr/lib64/php/modules/zip.so # <----
/opt/remi/php72/root/usr/share/doc/pecl/zip
Then just create symlink to this file in directory where php searches modules by default:
ln -s /opt/remi/php72/root/usr/lib64/php/modules/zip.so /usr/lib64/php/modules/zip.so
After this steps I finally saw zip extension in php -m output and now can use class ZipArchive.
Also you should probably restart your httpd service.
1 - Download manually the last ZIP pecl lib at https://pecl.php.net/package/zip
2 - Install it with pecl in the downloaded file
sudo pecl install zip-1.19.1.tgz
3 Enable zip on php.ini
extension=zip
Please check you are using latest libzip5 version 1.5.1 from remi-safe repository (which is mandatory, and enabled by default)
I wanted to try the latest version of PHP on Kubuntu 16.04, since then, it seems I can't use pdo with mysql.
When I launch php, I have the following warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /usr/lib/php/20170718/pdo_mysql (/usr/lib/php/20170718/pdo_mysql: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/pdo_mysql.so (/usr/lib/php/20170718/pdo_mysql.so: undefined symbol: pdo_parse_params)) in Unknown on line 0
I'm running
PHP 7.2.4-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Apr 5 2018 08:53:57) ( NTS )
I tried to fix with this solution : https://askubuntu.com/a/824505, but I've the same problem.
However, in the phpinfo, there's a driver found for PDO (mysql).
When I check a php -m, PDO and pdo_mysql are found.
In the /usr/lib/php/20170718 and /usr/lib/php/20151012 folder, there is a pdo_mysql.so.
I don't really know what else to try. Thanks in advance for your help.
sudo apt-get update
sudo apt-get install php7.2-pdo
In my case I had updated from Ubuntu 16.04 to 18.04, thus PHP 7.0 to 7.2.
Turns out PHP 7.0 was still (partly) installed, and was the active PHP-FPM handler for Apache.
Commands I used to resolve this: (as root or via sudo)
service php7.0-fpm stop
apt-get remove php7.0*
service php7.2-fpm restart
service apache2 restart
Be sure to copy any INI changes you made from /etc/php/7.0 to /etc/php/7.2 though.
I'm using phpbrew for switching between different versions of php. And now I can't install ioncube as php extension.
What I have already done:
Download from http://www.ioncube.com/loaders.php my version of extension (Linux 64 tar.gz v6.0.9 2017-1-26)
Unpack all and put ioncube_loader_lin_5.6.so to /home/kpot/.phpbrew/php/php-5.6.24-last/lib/php/extensions/debug-zts-20131226
Add extension=/home/kpot/.phpbrew/php/php-5.6.24-last/lib/php/extensions/debug-zts-20131226/ioncube_loader_lin_5.6.so in php.ini
Restart server with sudo service apache2 restart
When apply php -v got this PHP Warning: PHP Startup: Unable to load dynamic library '/home/kpot/.phpbrew/php/php-5.6.24-last/lib/php/extensions/debug-zts-20131226/ioncube_loader_lin_5.6.so' - /home/kpot/.phpbrew/php/php-5.6.24-last/lib/php/extensions/debug-zts-20131226/ioncube_loader_lin_5.6.so: undefined symbol: executor_globals in Unknown on line 0
after phpinfo() can't find anything associated with ioncube
Additional information:
uname -a
Linux KpoT 4.4.0-75-generic #96~14.04.1-Ubuntu SMP Thu Apr 20 11:06:30 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
php -i | grep extension_dir
extension_dir => /home/kpot/.phpbrew/php/php-5.6.24-last/lib/php/extensions/debug-zts-20131226 => /home/kpot/.phpbrew/php/php-5.6.24-last/lib/php/extensions/debug-zts-20131226
phpbrew - 1.21.6
First of all. When you unpack your archive with ioncube, pay attension to files with _ts at the end. In my case I have php with thread safe enabled(phpinfo()), so you must choose exactly that files.
Second problem occurs when php was compiled with debug. You must recompile your php without it.