First of all thanks in advance for the answers!
Kind of legacy server running still on CentOS 6
OS:
cat /etc/centos-release
CentOS release 6.10 [Final]
php:
php -v
PHP 7.1.33 [cli] [built: Oct 26 2019 11:22:12] [ NTS ]
Copyright [c] 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright [c] 1998-2018 Zend Technologies
what i have now:
rpm -qa | grep php
php71w-xml-7.1.33-1.w6.x86_64
php71w-pdo-7.1.33-1.w6.x86_64
php71w-common-7.1.33-1.w6.x86_64
php71w-mbstring-7.1.33-1.w6.x86_64
mod_php71w-7.1.33-1.w6.x86_64
php71w-mysqlnd-7.1.33-1.w6.x86_64
php71w-cli-7.1.33-1.w6.x86_64
yum list php73
lists a whole bunch of packages, same command for 74 lists nothing.
PHP 7.3 is enough.
I am a bit intimidated as i haven't found a good walkthrough for my version and i am afraid to not damage anything as i have some working apps on the server.
As i understand i have to do a
yum remove php*
then a something like this
yum --disablerepo=remi-php7x --enablerepo=remi-php74 install php php-pdo php-fpm php-gd php-mbstring php-mysql php-curl php-mcrypt php-json -y
Edit: I have done a yum update after updating centos 6's outdated repo links, all is up to date.
By On 2 May 2020 In Home, PHP The PHP Version 7.4.0 has been released on November 28, 2019. PHP 7.4 comes with a remarkable amount of new features. This version is RPM are available in the remi-php74 repository and we are using Remi and EPEL yum repositories for installing required packages. You can also check more features in the PHP official site. Useful Articles: In this article, we will help you to install PHP 7.4, 7.3, 7.2, 7.1 on CentOS/RHEL 7/6.
Configure Yum Repository
First, you need to install Remi and EPEL yum repositories on your system. Use the following command to install EPEL and Remi repository in your system.
# yum install epel-release
Use the following command based on your system
## For CentOS/RHEL 6 ## # rpm -Uvh //rpms.famillecollet.com/enterprise/remi-release-6.rpm ## For CentOS/RHEL 7 ## # rpm -Uvh //rpms.remirepo.net/enterprise/remi-release-7.rpm
Install PHP 7
Now, your system is ready for the PHP 7 installation. Use one of the following commands to install PHP 7.4 or PHP 7.3 or PHP 7.2 or PHP 7.1 on your system based on your requirements.
## Install PHP 7.4 ##
# yum --enablerepo=remi-php74 install php
## Install PHP 7.3 ##
# yum --enablerepo=remi-php73 install php
## Install PHP 7.2 ##
# yum --enablerepo=remi-php72 install php
## Install PHP 7.1 ##
# yum --enablerepo=remi-php71 install php
I have installed PHP 7.4 on my system. Now you are ready to run the following command to check PHP version on my system.
# php -v
PHP 7.4.5 [cli] [built: Apr 14 2020 12:54:33] [ NTS ] Copyright [c] The PHP Group Zend Engine v3.4.0, Copyright [c] Zend Technologies with Zend OPcache v7.4.5, Copyright [c], by Zend Technologies
Install PHP Modules
You may also need to install additional PHP modules based on your application requirements. Below command will install some more useful PHP modules.
## Install PHP 7.4 ##
# yum --enablerepo=remi-php74 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
## Install PHP 7.3 ##
# yum --enablerepo=remi-php73 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
## Install PHP 7.2 ##
# yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
## Install PHP 7.1 ##
# yum --enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt
You can run the following command to search other available PHP modules under configured yum repositories. Below example command search for all modules for PHP 7.3.
# yum --enablerepo=remi-php74 search php | grep php74
* remi-php74: mirror.innosol.asia php74.x86_64 : Package that installs PHP 7.4 php74-php.x86_64 : PHP scripting language for creating dynamic web sites php74-php-bcmath.x86_64 : A module for PHP applications for using the bcmath php74-php-brotli.x86_64 : Brotli Extension for PHP php74-php-cli.x86_64 : Command-line interface for PHP php74-php-common.x86_64 : Common files for PHP php74-php-componere.x86_64 : Composing PHP classes at runtime php74-php-dba.x86_64 : A database abstraction layer module for PHP applications php74-php-dbg.x86_64 : The interactive PHP debugger php74-php-devel.x86_64 : Files needed for building PHP extensions php74-php-embedded.x86_64 : PHP library for embedding in applications php74-php-enchant.x86_64 : Enchant spelling extension for PHP applications ... ...
Enjoy it!