CentOS 7 comes out with PHP 5.4 by default, this is quite old by today's standards and a lot of the inbuilt functions are missing. The following instructions will upgrade PHP from version 5.4 to 7.3
Confirm you have PHP 5.4 installed on the server
php --version
HP 5.4.16 (cli) (built: Apr 12 2018 19:02:01)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
Download the required repos
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
Enable the repos
yum install yum-utils yum-config-manager --enable remi-php73
Update the server (-y option updates without prompting)
yum -y update
Check PHP has been upgraded
php --version
PHP 7.3.17 (cli) (built: Apr 14 2020 08:29:22) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.17, Copyright (c) 1998-2018 Zend Technologies