PHP 7.2 and modules 'dom', 'mbstring', and 'simplexml'

Ali picture Ali · Jul 9, 2018 · Viewed 19.6k times · Source

I installed PHP 7.2 on my server and everything works fine except these three issues:

I face these problems:

The PHP extension dom is not loaded. Please contact your server administrator or visit http://php.net/manual/en/dom.installation.php for installation.

PHP extension mbstring is not loaded. Please contact your server administrator or visit http://php.net/manual/en/mbstring.installation.php for installation.

PHP extension simplexml is not loaded. Please contact your server administrator or visit http://php.net/manual/en/simplexml.installation.php for installation.

...

Now when I type php -m,

[root@localhost php.d]# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
sockets
SPL
sqlite3
standard
tokenizer
zlib

[Zend Modules]

[root@localhost php.d]#

It shows that there isn't any mbstring, dom or simplexml modules.

I've tried everything that I can find on google, but I can't seem to install those three modules.

php -v returns this:

PHP 7.2.7 (cli) (built: Jun 20 2018 08:21:26) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

What's wrong?

Answer

Lovepreet Singh picture Lovepreet Singh · Jul 9, 2018

Try installing the missing modules as:

sudo yum install php7.2-dom

sudo yum install php7.2-mbstring

sudo yum install php7.2-simplexml

Don't forget to restart server after installation.