Install PHP 7.3 in CentOS 8

CentOS 8 comes with PHP 7.2. To install PHP 7.3, you need to enable remi repo. You can download remi-release rpm file from

http://rpms.remirepo.net

Download and install remi-release rpm

cd ; wget http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf install remi-release-8.rpm

if you have older php version and don’t want to keep it, uninstall it with

dnf remove php-gd php-xml php-mbstring php-common php php-odbc php-mysqlnd php-json php-process php-cli php-fpm php-intl php-bcmath php-soap php-pdo 

Install PHP 7.3

dnf install php73

Set it as default PHP version

update-alternatives --install /usr/bin/php php /usr/bin/php73 1

Install PHP modules

dnf install -y php73-php php73-php-gd php73-php-fpm php73-php-pdo php73-php-xml php73-php-json php73-php-imap php73-php-intl php73-php-json php73-php-soap php73-php-bcmath php73-php-xmlrpc php73-php-mysqlnd php73-php-mbstring php73-php-zip

Install php-fpm package

dnf install php73-php-fpm

set php-fpm to start on boot

systemctl enable php73-php-fpm

Start php-fpm

systemctl start php73-php-fpm

Restart Apache

systemctl restart httpd

PHP 7.3 php.ini located at

/etc/opt/remi/php73/php.ini

Module directory for PHP 7.3 at

/opt/remi/php73/root/usr/lib64/php/modules/

Related Posts

CentOS 8

PHP

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *