I'm trying to install pdo mysql on ubuntu for php 7.1
sudo apt-get install php7.1-mysql
But I got E: Unable to locate package php7.1-mysql
Then I tried install from ondrej repository
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1-mysql
Still I got
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.1-mysql
E: Couldn't find any package by regex 'php7.1-mysql'
At the moment I haven't got any pdo modules enabled;
Can someone help please?
Related
I'm trying to install php8.0-curl on my server.
But it keeps giving me the following error:
$ sudo apt install php8.0-curl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package php8.0-curl
E: Couldn't find any package by glob 'php8.0-curl'
I followed the following steps, but with no success.
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install curl
sudo apt install php8.0-curl
I was using the wrong repositories.
Following this answer solved the issue.
https://serverfault.com/a/1106701
After adding the ppa ondrej/php, I try sudo apt-get install php7.4, but the output is
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.4
E: Couldn't find any package by glob 'php7.4'
E: Couldn't find any package by regex 'php7.4'
I have checked and there is a package that should install with that command, but I must be doing something wrong?
have you tried updating your rep?
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.4
php -v
I didn't pay enough attention, this package doesn't exist yet for ubuntu 19.04:
php7.4 7.4.2-6+ubuntu19.10.1+deb.sury.org+1 Ondrej Surý (2020-02-05)
php7.4 7.4.2-6+ubuntu18.04.1+deb.sury.org+1 Ondrej Surý (2020-02-05)
php7.4 7.4.2-6+ubuntu16.04.1+deb.sury.org+1 Ondrej Surý (2020-02-05)
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
I am trying to install curl on my ubunutu 14 server with php 7.2 installed. I run the following command:
sudo apt-get install php7.0-curl
but it gives error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-curl
E: Couldn't find any package by regex 'php7.0-curl'
I then tried to resolve this issue by running commands:
sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt install apache2 libapache2-mod-php7.0 php7.0
But that also end up with same "Couldn't find package" error.
Your Ubuntu distro trusty is too old and those packages aren't available. You will have to build the library from the source by yourself.
Here you can find solution your problem How do I install the ext-curl extension with PHP 7?
Shortly, try to execute
sudo apt-get install php-curl
Also you can use sudo apt-cache search curl which shows you available packages for installation.
I am not being able to install package php7.0-zip. The error I get after doing
sudo apt-get install php7.0-zip
Is:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0-zip
E: Couldn't find any package by regex 'php7.0-zip'
This is for an Ubuntu 14.04.5 LTS. My PHP version is 7.0.17.
I tried doing:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
And still getting the same "unable to locate" error.
I expect to solve my "Fatal error: Class 'ZipArchive' not found in" in Laravel 5.4, after installing zip package.
if you do sudo apt-cache search php7.0-* you should get a list of all packages.
The zip module should be at the bottom
If it isn't there you might wish to try
sudo add-apt-repository ppa:ondrej/php && sudo apt-get update instead of just add-apt-repository ppa:ondrej/php and see if that makes a difference.
Finally I couldn't find the package because I was using Ubuntu 14.04, and as is an unsupported Ubuntu version, there is no more php packages in the repository.