I can't upgrade nginx PHP version to latest on ubuntu 16 - php

I have tried to upgrade the PHP version. but I just get errors.
I tried this tutorial.
apt update
apt upgrade
apt install software-properties-common
add-apt-repository ppa:ondrej/nginx
apt update
apt upgrade
apt install php8.0 php8.0-cli php8.0-fpm php8.0-apcu php8.0-opcache
php8.0-common php8.0-pear php8.0-curl php8.0-zip php8.0-mcrypt php8.0-mysql
php8.0-mbstring php8.0-xml php8.0-gd php8.0-gmagick php8.0-imagick
php8.0-xmlrpc php7.3-maxminddb
but I get this error.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php8.0
E: Couldn't find any package by glob 'php8.0'
E: Couldn't find any package by regex 'php8.0'
E: Unable to locate package php8.0-cli
E: Couldn't find any package by glob 'php8.0-cli'
E: Couldn't find any package by regex 'php8.0-cli'
E: Unable to locate package php8.0-fpm
E: Couldn't find any package by glob 'php8.0-fpm'
E: Couldn't find any package by regex 'php8.0-fpm'
E: Unable to locate package php8.0-apcu
E: Couldn't find any package by glob 'php8.0-apcu'
E: Couldn't find any package by regex 'php8.0-apcu'
E: Unable to locate package php8.0-opcache
...
How can I solve this problem?
I have tried my tutorial. but just get same error like this.

As stated in the ppa description:
Only Supported Versions of PHP (http://php.net/supported-versions.php) for Supported Ubuntu Releases (https://wiki.ubuntu.com/Releases) are provided.
Ubuntu 16.04 is no longer supported since April 2021, so I think there is also no longer a xenial branch of php 8.0. I'd suggest to upgrade Ubuntu to ver. 20.04 LTS in order to be able to use php 8.0

Try apt full-upgrade and apt upgrade and the last command apt get update
try this three command, and restart the machine it will resolve.

Related

Use ODBC in PHP7.4 - Unable to locate package php7.4-odbc

I need to use functions from PHPs ODBC library (like odbc_connect) on my Ubuntu 16.04.6 LTS Server. Unfortunately, if I try to install php7.4-odbc with
sudo apt-get install php7.4-odbc
is fails with
E: Unable to locate package php7.4-odbc
E: Couldn't find any package by glob 'php7.4-odbc'
E: Couldn't find any package by regex 'php7.4-odbc'
How can I install PHPs ODBC package on this Server?
try this
sudo apt update
sudo apt install php-odbc

php 7.3 Unable to locate package php7.3-gd

I'm trying to install the php7.3-gd extension.
When I try to: sudo apt-get install -y php7.3-gd
I recieve the output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.3-gd
E: Couldn't find any package by glob 'php7.3-gd'
E: Couldn't find any package by regex 'php7.3-gd'
I tried to update my repo using the following awnser but to no avail.
Edit: I'm on ubuntu 19.08
php7.3-gd is available on Ubuntu 19.10.
First, you need upgrade your ubuntu to 19.10:
sudo do-release-upgrade -d
And then you can install it:
sudo apt install php7.3-gd

How to install php7.0-mbstring in Ubuntu 17.04?

I'm trying to install phpUnit in my system. At first it asked to install composer then to install mbstring.Now I'm I tried using all of the below,
sudo apt-get install php7.0-mbstring
sudo apt-get dist-upgrade
and https://futurestud.io/tutorials/how-to-fix-ubuntu-debian-apt-get-404-not-found-repository-errors
this. Still getting the same type of error.
E: Unable to locate package php7.0-mbstring
E: Couldn't find any package by glob 'php7.0-mbstring'
E: Couldn't find any package by regex 'php7.0-mbstring'
This question is already asked before but it doesn't have any answer.
UPDATE:
I tried this both also.
I have tried this link also.
What I'm doing wrong? Thank you
Version 17.04 is end-of-life as of January 13, 2018. You can't grab php-mbstring because the release file for zesty-security repository no longer exists.
Ubuntu Forums thread on this subject

unableto install php7 on ubuntu

I want to install php7 or 7.1 in Ubuntu but i can't
I try with this code :
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
and this is result :
sudo: unable to resolve host myvps
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.1
E: Couldn't find any package by regex 'php7.1'
Also for PHP 7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0
E: Couldn't find any package by regex 'php7.0'
But i know i can install php5 but i don't want !
se result of this commend php -v
root#myvps:~# php -v
The program 'php' is currently not installed. You can install it by typing:
apt-get install php5-cli
and here is my ubuntu information :
root#myvps:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid
whats wrong ? is it possible to solve this problem ?
All code is correct however we need to attention to Kernel release end of life it is so important !
My problem is from here !
and for solve that we have 2 option :
first upgrade Kernel release (recommended)
second use from this hack (at your own risk)
Try without adding any repositories.
sudo apt-get install php7.0

E: Unable to locate package <pkg name>

I am new to php and drupal.my problem is i tried to install php and related pkgs in terminal.I followed this command to install php5
sudo apt-get install php5 php5-cli php5-common php5-devel php5-mbstring php5-gd php5-mysql php5-pdo php5-xmlrpc php5-xml php5-pear
after i entered this command i saw the error like as below.
E: Unable to locate package php5-devel
E: Unable to locate package php5-mbstring
E: Unable to locate package php5-pdo
E: Unable to locate package php5-xml
E: Unable to locate package php5-pear
I tried many ways to get solution for this but i didn't got solution to this.After many hours i taken reinstall ubuntu after that again same error is shows me. Can any one help me from this headache error.
Try replacing php5 with php like so sudo apt-get install php-curl or if you have php7.0 installed use this command sudo apt-get install php7.0-curl.
You can check your php version using command php -v.

Categories