FreePBX FreePBX 16.0.19 - can't install imagick php extension

I just recently installed the 16.0.19 disto and unable to install the imagick php extension. It gives the following:

pecl install imagick
downloading imagick-3.7.0.tgz …
Starting to download imagick-3.7.0.tgz (360,138 bytes)
…done: 360,138 bytes
33 source files, building
running: phpize
Can’t find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
ERROR: `phpize’ failed

It appears that php-devel is required, but when trying to install, I get this:
yum install php-devel
Loaded plugins: fastestmirror, versionlock
Loading mirror speeds from cached hostfile
Resolving Dependencies
→ Running transaction check
—> Package php-devel.x86_64 0:5.4.16-48.el7 will be installed
→ Processing Dependency: php-cli(x86-64) = 5.4.16-48.el7 for package: php-devel-5.4.16-48.el7.x86_64
→ Processing Dependency: pcre-devel(x86-64) for package: php-devel-5.4.16-48.el7.x86_64
→ Processing Dependency: automake for package: php-devel-5.4.16-48.el7.x86_64
→ Processing Dependency: autoconf for package: php-devel-5.4.16-48.el7.x86_64
→ Running transaction check
—> Package autoconf.noarch 0:2.69-11.el7 will be installed
→ Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
—> Package automake.noarch 0:1.13.4-3.el7 will be installed
→ Processing Dependency: perl(Thread::Queue) for package: automake-1.13.4-3.el7.noarch
→ Processing Dependency: perl(TAP::Parser) for package: automake-1.13.4-3.el7.noarch
—> Package pcre-devel.x86_64 0:8.32-17.el7 will be installed
—> Package php-devel.x86_64 0:5.4.16-48.el7 will be installed
→ Processing Dependency: php-cli(x86-64) = 5.4.16-48.el7 for package: php-devel-5.4.16-48.el7.x86_64
→ Running transaction check
—> Package m4.x86_64 0:1.4.16-10.el7 will be installed
—> Package perl-Test-Harness.noarch 0:3.28-3.el7 will be installed
—> Package perl-Thread-Queue.noarch 0:3.02-2.el7 will be installed
—> Package php-devel.x86_64 0:5.4.16-48.el7 will be installed
→ Processing Dependency: php-cli(x86-64) = 5.4.16-48.el7 for package: php-devel-5.4.16-48.el7.x86_64
→ Finished Dependency Resolution
Error: Package: php-devel-5.4.16-48.el7.x86_64 (sng-base)
Requires: php-cli(x86-64) = 5.4.16-48.el7
Installed: php-cli-7.4.16-1.el7.remi.x86_64 (@anaconda/2203)
php-cli(x86-64) = 7.4.16-1.el7.remi
Available: php-cli-5.4.16-48.el7.x86_64 (sng-base)
php-cli(x86-64) = 5.4.16-48.el7
Available: php56w-cli-5.6.35-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 5.6.35-1.sng7
Available: php56w-cli-5.6.36-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 5.6.36-1.sng7
Available: php56w-cli-5.6.40-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 5.6.40-1.sng7
Available: php71w-cli-7.1.15-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 7.1.15-1.sng7
Available: php71w-cli-7.1.16-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 7.1.16-1.sng7
Available: php71w-cli-7.1.20-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 7.1.20-1.sng7
Available: php72w-cli-7.2.7-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 7.2.7-1.sng7
Available: php72w-cli-7.2.8-1.sng7.x86_64 (sng-pkgs)
php-cli(x86-64) = 7.2.8-1.sng7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

The distro came with php 7.4, so not sure why it’s trying to install the php-devel 5.4 version. Is this an issue with the repos? Any ideas how to resolve this?

You may have to put in a request. I don’t believe that package is used by FreePBX so they may not have built it.

Okay, I just put in a request. Thanks for the feedback!

At the current stage you would need a different repository to install it (php-7.4). I succeeded on one system, but it was rather complicated. Everything depends on something…and I was surprised how difficult it was.
Do you use Cisco phones and the script for a camera image (door)?

Yes, I managed add another repo and got it installed; however, it made the GUI go a little haywire. Fortunately, I took a snapshot prior and just reverted back until I have more time to dig into it.

I do use cisco phones, but am not using any script for a camera images, although it does sound like something neat to have. I need imagick for creating a report.

For anyone looking to do the same, here are the steps:

yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum-config-manager --enable remi-php74
yum install php-devel
[Install whatever extensions you need]
[add extensions to php.ini file…i.e. extension=imagick.so]
service httpd restart

You can do this to put the repos back as they were:
yum-config-manager --disable remi-php74
yum-config-manager --disable remi-safe

That’s it!

1 Like

Here is the description of the door-image-cisco script…in case you wanna try…you also need imagick for that
https://hq.ipas.nl/?p=43

And that’s a threat, where it is discussed

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.