Author Topic: How to update Imagick?  (Read 931 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to update Imagick?
« on: September 02, 2024, 08:22:08 PM »
Hello people!

I have this error on my CWP, how I can update it?

Quote
PHP Warning: Version warning: Imagick was compiled against ImageMagick version 1692 but version 1693 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0

Thank you so much!

Offline
***
Re: How to update Imagick?
« Reply #1 on: September 03, 2024, 10:12:42 AM »
Try to update ImageMagick using:

(for centos-8, almalinux-8/9, rockylinux-8/9)
Code: [Select]
dnf update ImageMagick
In case you use older OS (Centos-6/7, etc) then most likely you need to recompile ImageMagick manually.
« Last Edit: September 03, 2024, 10:14:36 AM by cyberspace »

Offline
*
Re: How to update Imagick?
« Reply #2 on: September 06, 2024, 10:14:48 AM »
hello,

we are also seeing that the error
Warning: Version warning: Imagick was compiled against ImageMagick version 1692 but version 1693 is loaded. Imagick will run but may behave surprisingly in Unknown on line 0


dnf update ImageMagick
wont fix.
In our case we also see that prestashop stop working as it should ie: combinations and cart arenn't working as should be.


Any idea why  imagick comes with this problem and how to solve?

Offline
*****
Re: How to update Imagick?
« Reply #3 on: September 06, 2024, 11:38:48 AM »
On some systems, using dnf to remove & install and rebuilding PHP fixes the problem.

But doesn't seem 100%.

Offline
***
Re: How to update Imagick?
« Reply #4 on: September 06, 2024, 07:08:27 PM »
Then try to recompile imagick manually. Follow the steps listed bellow:

Code: [Select]
cd /usr/local/src/
wget https://pecl.php.net/get/imagick-3.7.0.tgz
tar -xvzf imagick-3.7.0.tgz
cd imagick*
/opt/alt/phpXX/usr/bin/phpize
./configure --with-php-config=/opt/alt/phpXX/usr/bin/php-config
make
make install

Make sure to replace "phpXX" with path to the correct php version.
« Last Edit: September 06, 2024, 07:31:30 PM by cyberspace »

Offline
*****
Re: How to update Imagick?
« Reply #5 on: November 29, 2024, 02:06:51 AM »
@cyberspace

Tried what you listed, but when you do
Code: [Select]
cd imagick*The server gives:
Quote
-bash: cd: too many arguments

So I did:
Code: [Select]
cd imagick-3.7.0
But there is no directory there called /opt/alt/phpXX/usr/bin/phpize
Quote
-bash: cd: /opt/alt/phpXX/usr/bin/phpize: No such file or directory


The pecl script when I try:
Code: [Select]
sudo pecl uninstall imagick && sudo pecl install imagickAsks for:
Quote
Please provide the prefix of ImageMagick installation [autodetect] :
I just hit Enter for autodetect, and it installs Imagick 3.7.0, but PHP still isn't seeing it.

Would really like to get this bug resolved once & for all.

Offline
*****
Re: How to update Imagick?
« Reply #6 on: November 29, 2024, 07:42:25 PM »
Too literal?
Code: [Select]
[root@srv1 overseer]# ls -al /opt/alt/php*/usr/bin/php-config
-rwxr-xr-x. 1 root root 3530 Mar 30  2021 /opt/alt/php-fpm56/usr/bin/php-config
-rwxr-xr-x  1 root root 3763 Dec  1  2022 /opt/alt/php-fpm74/usr/bin/php-config
-rwxr-xr-x  1 root root 3883 Nov 22 03:50 /opt/alt/php-fpm81/usr/bin/php-config

Offline
*****
Re: How to update Imagick?
« Reply #7 on: December 01, 2024, 04:08:56 AM »
Maybe that's the problem.

Not using PHP-FPM, using PHP Selector for PHP-CGI.

But it a config option, so you would think it would work. :/

Offline
***
Re: How to update Imagick?
« Reply #8 on: December 01, 2024, 09:49:07 AM »
Quote
-bash: cd: too many arguments

it seems you have two or more folders called like "imagick-something". That is why you get the error when run "cd imagick*"

Quote
-bash: cd: /opt/alt/phpXX/usr/bin/phpize: No such file or directory

overseer right. You just need to specify the correct location of php-config. Each php version has own "php-config". So if you want to build imagick for php 5.6 then run:

Code: [Select]
./configure --with-php-config=/opt/alt/php56/usr/bin/php-config
for php 7.1:

Code: [Select]
./configure --with-php-config=/opt/alt/php71/usr/bin/php-config
etc, but for main php version:

Code: [Select]
./configure --with-php-config=/usr/local/bin/php-config

Offline
*****
Re: How to update Imagick?
« Reply #9 on: December 01, 2024, 05:56:40 PM »
Still no joy.

Ran:
Code: [Select]
phpize ./configure --with-php-config=/usr/local/bin/php-config
Quote
Configuring for:
PHP Api Version:         20230831
Zend Module Api No:      20230831
Zend Extension Api No:   420230831

But then
Code: [Select]
php -v
Quote
PHP Warning:  PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so (/usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so: cannot open shared object file: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so.so (/usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 8.3.14 (cli) (built: Dec  1 2024 17:10:45) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.14, Copyright (c) Zend Technologies

Offline
***
Re: How to update Imagick?
« Reply #10 on: December 01, 2024, 07:12:25 PM »
Don't you get errors when you run `make` `make install` ?

If no errors then run:

Code: [Select]
ls `php -i| grep "^extension_dir" |awk '{print $5}'`/imagick.so

You should get something like:
Code: [Select]
/usr/local/lib/php/extensions/no-debug-non-zts-xxxxxxxxx/imagick.soif you get:

"No such file or directory"

then make sure all previous steps (see my first post in this thread) are completed without errors.

In other case run:

Code: [Select]
php --ini
and check every file listed in output to make sure the path to imagick.so is specified correctly. There is just one record associated with imagick.so.

Offline
***
Re: How to update Imagick?
« Reply #11 on: December 01, 2024, 10:51:24 PM »

Ran:
Code: [Select]
phpize ./configure --with-php-config=/usr/local/bin/php-config

phpize and configure are two separate commands:

Code: [Select]
phpize
./configure --with-php-config=/usr/local/bin/php-config

Offline
*****
Re: How to update Imagick?
« Reply #12 on: December 02, 2024, 04:14:24 AM »
Once I did those 2 commands separate it worked.

Now to see if it stays when PHP gets updated next time.

Thanks for your help @cyberspace