SOLVED PHP 8 and PECL imagick not working

Operating System & Version
Cloudlinux 7.9
cPanel & WHM Version
100.0.2

daynight

Member
Jan 5, 2021
5
1
3
Finland
cPanel Access Level
Root Administrator
Hi,

I've got WHM (v100.0.2) on Cloudlinux 7.9 server. Default PHP version is 8.0 with mod_lsapi as php-handler. CageFS is enabled for all users.

I've successfully installed PECL imagick package for PHP 7.4 and PHP 8.0. No errors during install and i rebooted the server.

I've been doing testing if imagick is working, here are results:

- PHP 7.4, PHP-FPM (as PHP-handler) OK
- PHP 7.4, mod_lsapi OK
- PHP 8.0, PHP-FPM OK
- PHP 8.0, mod_lsapi NOT OK

I have no clue why imagick is not working when i'm using PHP 8.0 and mod_lsapi as handler. Same cPanel account with PHP-FPM as handler works fine. I'm using MultiPHP to change the PHP version.

PHP 8.0, PHP-FPM:

- PHPInfo says the PECL ini is loaded
- PHPInfo lists imagick
- Imagick is tested and working

PHP 8.0, mod_lsapi:

- PHPInfo says the PECL ini is loaded
- PHPInfo does not list imagick
- Imagick test fails. PHP error: Fatal error: Uncaught Error: Class "Imagick" not found in ...

Any tips how to solve this?
 
Last edited:

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,051
106
118
Houston, TX
cPanel Access Level
Root Administrator

daynight

Member
Jan 5, 2021
5
1
3
Finland
cPanel Access Level
Root Administrator
Thank you for answering. Problem is still there.

1)
Restarting the whole virtual server does not restart LSPHP process/processes? Please explain how is that possible?

2)
I tried this method mentioned in the docs: touch /home/CPANELUSERNAME/mod_lsapi_reset_me
No help there. The file 'mod_lsapi_reset_me' is sitting in the users home directory.
PHP gives same error as before.

3)
I attached a screenshot of partial phpinfo page. See the screenshot. There's this line:

Additional .ini files parsed: there's long list of different PHP extensions and the last additional ini file is: /opt/cpanel/ea-php80/root/etc/php.d/zzzzzzz-pecl.ini

This 'zzzzzzz-pecl.ini' includes following:
extension="imagick.so"

To my understanding PHP 8.0 (with mod_lsapi as handler) loaded correct ini files. But still imagick is not working.

4)
Imagick is working with PHP 7.4 (mod_lsapi). I installed PHP 7.4 extension same way as PHP 8.0 version. I didn't have to restart any LSPHP services or do any jumps or hoops. It just worked right of the bat.

Any further tips i should try?
 

Attachments

daynight

Member
Jan 5, 2021
5
1
3
Finland
cPanel Access Level
Root Administrator
Problem solved!

I've been clicking the CageFS update command via WHM -> Plugins -> CageFS -> Update CageFS skeleton. So i thought CageFS is not part of this problem. Seems like the CageFS was the problem.

I forced the CageFS update on: cagefsctl --force-update

and now imagick extension is working with PHP 8.0 (mod_lsapi). Finally. Now i can do my work and update the production servers.

If someone knows why CageFS was the problem, please tell :)