0

So I'm trying to install the php modules: mysqli, exif, mbstring and dom. But I'm unable to do so... I have apparently managed to install exif and mbstring with this command, yet it doesn't appear on the list of installed modules:

[root@~]# php -v
PHP 8.1.27 (cli) (built: Jan 24 2024 00:32:48) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.27, Copyright (c) Zend Technologies

[root@~]# yum install ea-php81-php-exif.x86_64
Last metadata expiration check: 1:50:15 ago on Wed 14 Feb 2024 11:29:44 AM -03.
Package ea-php81-php-exif-8.1.27-1.1.3.cpanel.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

[root@~]# yum install ea-php81-php-mbstring.x86_64
Last metadata expiration check: 1:54:38 ago on Wed 14 Feb 2024 11:29:44 AM -03.
Package ea-php81-php-mbstring-8.1.27-1.1.3.cpanel.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

[root@~]# php -m
[PHP Modules]
Core
date
filter
hash
json
libxml
openssl
pcntl
pcre
readline
Reflection
session
SPL
standard
zlib

And I also can't find the mysqli package "No matches found." I have also added the ones I was able to install in the php.ini file but it still doesn't work. This is one of the messages in the error_log:

[14-Feb-2024 17:31:47 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: ./mbstring.so (./mbstring.so: cannot open shared object file: No such file or directory), ./mbstring.so.so (./mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

1 Answer 1

0

You need to tell PHP to load the modules. Check which ini file PHP is using (php -i | grep Configuration) and that you don't have multiple versions of PHP installed. Then check the ini files (and conf.d/* in same dir) for extension=mbstring etc.

10
  • I have done that already, forgot to write it, I added: extension = exif.so extension = mbstring.so But it still doesn't work. This is one of the lines in the error_log: [14-Feb-2024 17:31:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'mbstring.so' (tried: ./mbstring.so (./mbstring.so: cannot open shared object file: No such file or directory), ./mbstring.so.so (./mbstring.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Feb 15 at 13:57
  • ....and did you investigate why PHP can't find the extension? I suspect you may have mixed up different distributions of PHP with different file layouts (this is not really fixable - you need to source your PHP stack from a single source).
    – symcbean
    Feb 15 at 15:26
  • I don't know where I can look for the problem, if you could point me in the right direction then I'd be able to tell you, I've barely any experience these things as you can probably tell. And I don't think we have different distributions of PHP, it was pretty much preinstalled when we got this VPS. Feb 15 at 16:05
  • rpm -q -a | grep php will list all the PHP rms installed on your host. e.g. rpm -q -l ea-php81-php-exif will list the files installed (and their paths). Compare that against your PHP config.
    – symcbean
    Feb 15 at 16:28
  • So I should compare whatever rpm -q -l ea-php81-php-exif gives me and what exactly in my php.ini? Feb 15 at 17:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .