How to install PHP extension 'dstk.so' for PHP7.4?

I’m using multiple PHP 7.4 and PHP 8.3.
I have to install ‘dstk.so’ php extension only for PHP7.4.

So I uploaded ‘dstk.so’ file directory : /usr/lib/php/7.4/dstk.so

But this error.

root@hestiacp:/usr/lib/php/7.4# php -i | grep -iE ‘^PHP Version|extension_dir’
PHP Warning: PHP Startup: Unable to load dynamic library ‘dstk’ (tried: /usr/lib/php/20230831/dstk (/usr/lib/php/20230831/dstk: cannot open shared object file: No such file or directory), /usr/lib/php/20230831/dstk.so (/usr/lib/php/20230831/dstk.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Version => 8.3.6
PHP Version => 8.3.6
extension_dir => /usr/lib/php/20230831 => /usr/lib/php/20230831

This is my PHP7.4 php.ini setting screenshot.

What is my problem?

You should upload it to the right dir for your php version. To know what is the right extension dir used by php 7.4:

php7.4 -i | grep extension_dir | awk '{print $NF}'

Keep in mind that if you edited php conf from Hestia Web UI, you are modifying the conf for ALL your installed PHP versions so remove the conf added, save it and now edit /etc/php/7.4/fpm/php.ini manually to add the right conf for your extension.

1 Like