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

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

Related

Package php7.0-curl is not available, but is referred to by another package

EDIT : The tutorial that I was following was outdated, hense did not work. I found the solution while following this video tutorial
I was following this tutorial to install nextcloud on my homeserver.
After installing the database software, I need to install the last component - PHP.
However, after running the commands displayed on the tutorial I run into some errors :
Package php7.0-common is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source
I already tried to find solutions but they seem outdated, that's why I raise this new topic
Thank you very much for your help.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
While browsing solutions, I have already ran some commands to fix the problem :
sudo add-apt-repository ppa:ondrej/php-7.0 sudo apt-get install software-properties-common -y sudo apt-get update sudo apt-cache search php7.0-curl
and sudo apt-get install php7.0-curl from here

Unable to Install PHP8.0 and php8.0-pgsql on Ubuntu 21.04

I am trying to install php8.0-pgsql on my local system, but failed to install as version is not available on ubuntu release hairsuite. So for this I have remove my PHP version from my local system and try to re-install the PHP8.0 on my local system but failed to install as I have implemented different solutions like PPA and certificates but no success. Now when run following commands to install PHP8.0 to system facing following error
installation commands
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.0
sudo apt install php8.0-common php8.0-cli
Error
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0
E: Couldn't find any package by glob 'php8.0'
I don't know what is root cause of this issue as I have spent a lot of time in searching the errors but failed. Anyone suggest helpfull solution that how I can install php on my system with PHP8.0-pgsql too.
Ubuntu 21.04 has reached its end of life in January 2022, and ondrej/php does not support any EOL version. You need to upgrade your Ubuntu version first to be able to use this repository again

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

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.

Not able to re-install php again on ubuntu

I want to update php version from 7.0 to 7.1 so i tried update php commands to update php version on ubuntu system.
But its not updated, so i removed php 7.0 version using purge command
sudo apt-get purge 'php*'
These are the commands i tried for update php7.1 version after uninstall php7.0
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1 php7.1-common
Getting error in command prompt as
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 glob 'php7.1'
E: Couldn't find any package by regex 'php7.1'
E: Unable to locate package php7.1-common
E: Couldn't find any package by glob 'php7.1-common'
E: Couldn't find any package by regex 'php7.1-common'
What im missing or did any thing wrong here?
It seems like php7.1 and php7.1-common packages are not available in your apt's sources.
I am assuming you are using the latest Ubuntu 18 LTS.
You could install php7.2 from the repositories, however older versions are not included anymore. You would have to install them manually.
For Version 7.2
sudo apt update
sudo apt install php7.2 php7.2-common
php -v
For Version 7.1
Download php
Extract the downloaded archive
Follow the included readme file
other options
If you are developing with different versions of PHP you might want to look into PHP docker containers
PHPDocker.io can be a good starting point.
EDIT: Also maybe consider posting this question on askubuntu instead, they might have more specific knowledge there.
You need to remove the old version before adding the new one.
Try: sudo apt-get remove php7.0*
Also it is useful to list all php packages to check if you are installing all you need.
sudo apt-get list php*
Then it is safe to run your commands.

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

Categories