Question

Unable to locate package php7.3

Posted February 22, 2020 300 views
PHP

I am trying to upgrade php7.3 version but i am getting this issue “Unable to locate package php7.3”

could you solve please?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hi @rajviswas,

Since you haven’t actually secified an OS, I’ll provide you with the steps you need to use to install PHP 7.3 on a CentOS 7 machine

To install ANY PHP version you wish, you can follow these steps bellow just change the php version to your needs

Install EPEL yum repository on your system

yum install epel-release

Install Remi repository

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

Now onto the proper installation

Your system is prepared for the PHP installation from yum repositories. Use one of the following commands to install PHP 7.3 or PHP 7.2 or PHP 7.1 on your system based on your requirements

## 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

Now running the following command to check current active PHP version on my system.

php -v
PHP 7.2.23 (cli) (built: Sep 25 2019 07:38:48) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 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.

### For PHP 7.3
yum --enablerepo=remi-php73 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

### For PHP 7.2
yum --enablerepo=remi-php72 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

### For PHP 7.1
yum --enablerepo=remi-php71 install php-xml php-soap php-xmlrpc php-mbstring php-json php-gd php-mcrypt

Any other extension you would like to install, you can do it like

### For PHP 7.2
yum --enablerepo=remi-php72 install php-extensioname

Kind regards,
KDSys

  • Hi KDSys,

    Thanks for your detailed reply, I’m for sorry late reply as well as unable to mention operating system.

    I’m using Ubuntu 14.04.

    Regards,
    Raja

    • Hi @rajviswas,

      The above should commands are for CentOS so for Ubuntu, you can use the following

      sudo apt install software-properties-common
      sudo add-apt-repository ppa:ondrej/php
      sudo apt update
      

      Install PHP 7.3 for Apache

      sudo apt install php7.3
      

      Install PHP 7.3 for Nginx

      sudo apt install php7.3-fpm
      

      Install PHP 7.3 Extensions

      You can use the following command to install the most needed PHP extensions

      sudo apt install php7.3-common php7.3-mysql php7.3-xml php7.3-xmlrpc php7.3-curl php7.3-gd php7.3-imagick php7.3-cli php7.3-dev php7.3-imap php7.3-mbstring php7.3-opcache php7.3-soap php7.3-zip php7.3-intl -y
      

      Regards,
      KDSys

      • Excuse me for the second comment however using 14.04 now it’s a BIG security risk! I’ll recommend moving to Ubuntu 18.04 right away as 14.04 has been declared as EOT(End of Time) since April 30, 2019.

        Regards,
        KDSys

Submit an Answer