Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Gabotronix's avatar

Issue downloading imagick php module for php 7.3 in ubuntu

in my laravel app I use laravel intervention image, I want to use imagick driver instrad of gd.

In my ubuntu server I use php 7.3, for example when I do php -ini I get the following:

/etc/php/7.3/cli

Along with the following error , probably about a mismatched php-imagick version

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20170718/imagick.so' (tried: /usr/lib/php/20170718/imagick.so (/usr/lib/php/20170718/imagick.so: undefined symbol: _zval_ptr_dtor), /usr/lib/php/20180731//usr/lib/php/20170718/imagick.so.so (/usr/lib/php/20180731//usr/lib/php/20170718/imagick.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

I download php-imagick using this command:

sudo apt-get install php-imagick

When I install php-imagick with this command:

sudo apt-get install php-imagick

I get this logs , As you can see the version being installed is for php7.2 while I use php7.3

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  php-imagick
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 0 B/90.7 kB of archives.
After this operation, 477 kB of additional disk space will be used.
Selecting previously unselected package php-imagick.
(Reading database ... 103072 files and directories currently installed.)
Preparing to unpack .../php-imagick_3.4.3~rc2-2ubuntu4.1_amd64.deb ...
Unpacking php-imagick (3.4.3~rc2-2ubuntu4.1) ...
Setting up php-imagick (3.4.3~rc2-2ubuntu4.1) ...
Processing triggers for php7.2-phpdbg (7.2.24-0ubuntu0.18.04.17) ...
Processing triggers for php7.2-cli (7.2.24-0ubuntu0.18.04.17) ...

I also edited my php.ini file with command sudo nano /etc/php/7.3/cli/php.ini, I tried with:

extension=imagick.so

and

extension=/usr/lib/php/20170718/imagick.so

But I still can't get php to recognize php-imagick module, I tried to download with command bellow but it says its : Unable to locate package php7.3-imagick

sudo apt-get install php7.3-imagick

And when I try to find where imagick is installed I use sudo find /usr -name imagick.so

and get the following:

/usr/lib/php/20170718/imagick.so

```
0 likes
0 replies

Please or to participate in this conversation.