Install redis extension for php 7.4 on Debian server - php

I'd like to install php7.4-redis on my debian server. My php is 7.4 version.
When I run the "sudo apt install php7.4-redis" command , it shows 404 not found so I can't finish my setting.
However , I found the page has other version :
php7.4-redis version
I've run command "sudo apt-get update" to update the repository but why am I still getting the 404 error?
sudo apt install php7.4-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
php7.4-igbinary
The following NEW packages will be installed:
php7.4-igbinary php7.4-redis
0 upgraded, 2 newly installed, 0 to remove and 70 not upgraded.
Need to get 142 kB/202 kB of archives.
After this operation, 848 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 https://packages.sury.org/php stretch/main amd64 php7.4-redis amd64 5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4
404 Not Found
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php-redis/php7.4-redis_5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Try running apt update, then it should work afterwards.
APT caches the packages available from each repository locally when running apt update. If you install a package, apt will use this cache. However, when a package is updated on the server and the old version gets deleted, apt will try to retrieve a no longer present file. This is indicated by this log output:
404 Not Found
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php-redis/php7.4-redis_5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4_amd64.deb 404 Not Found
If you take a look at the repos listing, your Version 5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4 is notably missing. Thus, after an apt update apt will know from where to load the package.
EDIT: You have an old signing key from php sury on your system, thus the repo can not be updated and the current version to download can not be obtained. This is a known issue, I faced it to on all my hosts.
In the linked GitHub thread, the recommended fix was to simple run these commands (posted by stefanux):
$ apt-key del 95BD4743 # If this throws an error about the key not being present, it's fine
$ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
$ apt-get update
Now you should be able to install the redis package.

Related

Issue installing mysql-server-5.6 on Ubuntu 16.04

I am getting this error message when I try to install mysql-server-5.6: sudo apt-get install mysql-server-5.6:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-server-5.6
0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded.
Need to get 0 B/6,004 kB of archives.
After this operation, 52.7 MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 75769 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb ...
Aborting downgrade from (at least) 5.7 to 5.6.
If are sure you want to downgrade to 5.6, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.6_5.6.35-1+deb.sury.org~xenial+0.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
mysql-client-5.6 were installed normally.
I first, uninstalled mysql-server-5.7:
sudo apt-get remove dbconfig-mysql
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
I added repos using this 2 methods:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu trusty universe'
sudo apt-get update
and
sudo add-apt-repository -y ppa:ondrej/mysql-5.6
sudo apt-get update
Notice that I also installed PHP 5.6 without any problem.
Since all my project depend on MCRYPT, I have to install this version in order to it to works well.
I used mysql-server-5.7 but it is not compatible ... datas are not inserted into mysql server.
Your help is needed, thank you in advance.
I think the issue is with the mysql client, because you already have it and it is trying to install it, which is causing the error.
Run this command to cleanup unused libraries:
sudo apt-get autoremove
and then try to install it again

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.

Conflict when installing PHP intl extension for composer on Centos 7

I am trying to do a Magento 2 DRC installation on a remote linux server, running Centos 7, Apache 2.4.6, MariaDB and PHP v5.6.9. When I try to install Composer I get the following message:
$ cd /var/www/html/magento2 && composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested PHP extension ext-intl * is missing from your system.
I have installed ext-intl using:
yum list php*intl
and
yum install php-intl
But is still gives me the same message.
I have tried various other installations to get around the problem, to no avail. Any suggestions would be gratefully erceived as it is stalling the project.
Would it help to downgrade to PHP 5.5?
You can follow the below steps for magento2 installation on Centos 7.
http://gotechnies.com/install-magento2-centos-7/
There are few easy steps to install Magento 2(M2) on Centos Distro.
Step 1-:
First of all we need to add few EPEL repositories for the php5.6, mysql-server5.6, and phpmyadmin.
# EPEL Repository for php5.6
$ rpm -iUvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ rpm -iUvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
# EPEL Repository for mysql-server5.6
$rpm -iUvh http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
# EPEL Repository for phpMyadmin on Centos 7
$ rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
$ yum -y update
Step 2-:
Install Require packages like apache, php5.6, mysql-server, phpmyadmin.
$ yum install-y httpd php mysql-server phpmyadmin php56w-mcrypt php56w-intl php56w-xsl git
To allow the phpmyadmin in apache 2.4 add the line
Require all granted
Readmore go to above link
Magento2 installation on RHEL/Centos 7 with Php7.
Subscribing to the IUS Community Project Repository
Since PHP 7.x is not yet packaged in official repositories for the major distributions, we’ll have to rely on a third-party source. Several repositories offer PHP 7 RPM files. We’ll use the IUS repository.
IUS offers an installation script for subscribing to their repository and importing associated GPG keys. Make sure you’re in your home directory, and retrieve the script using curl:
curl 'https://setup.ius.io/' -o setup-ius.sh
sudo bash setup-ius.sh
Install Required Packages-:
sudo yum install -y mod_php70u php70u-cli php70u-mysqlnd php70u-json php70u-gd php70u-dom php70u-simplexml php70u-mcrypt php70u-intl httpd mysql-server git
See my Article for Complete Installation magento2-php7-centos7-mysql5.7
The extension has to be installed and activated for the command line PHP, not only for the web server PHP. If you run php -i, which is the CLI equivalent of running phpinfo(), you should see a section containing info about the "intl" extension. If this is missing, you'd also see the path to the "php.ini" file that is being used - this is where you should double check whether or not the extension is activated or not.
Most of the time, it is not.

install php on top of already installed apache2 server

I have already installed the apache2 on my raspberry pi (raspbian OS) when setting up a svn server. Now I want to add a web server running php and mysql. What is the best way to do this without messing with any existing configurations on my apache2?
Would this be okay to execute on command line or is this package overwriting my existing apache2 install:
$ sudo apt-get install php5-common libapache2-mod-php5 php5-cli
The package in question is 'libapache2-mod-php5'.
Cheers
First of all, I've never worked with Raspberry Pi, but will try to give an answer. As you're only installing a module for apache and you're using the prefork compiled version (which is still default if I'm not mistaken). I think there will be no alterations in the configuration, perhaps only some rules will be added to handle PHP files.
To check if you're using Prefork, run this on command line (works on regular linux distributions):
apache2 -l
If you can find prefork.c in the list, I guess you're safe.
Please note that this is from personal experience with default unix distributions! I have never worked with Raspberry Pi (yet).
If you run the following commands all the dependencies will be resolved (it will also install libapache2-mod-php5). You can read about LAMP install in Raspberry Pi in the chapter 8 "A LAMP of Your Own", of the book "Learn Raspberry Pi with Linux", by Peter Membrey and David Hows, Apress, 2012.
$ sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
heirloom-mailx libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.5
mysql-common mysql-server-5.5 mysql-server-core-5.5
Suggested packages:
libipc-sharedcache-perl libterm-readkey-perl tinyca
The following NEW packages will be installed:
heirloom-mailx libaio1 libdbd-mysql-perl libdbi-perl libhtml-template-perl
libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client-5.5
mysql-common mysql-server mysql-server-5.5 mysql-server-core-5.5
0 upgraded, 13 newly installed, 0 to remove and 84 not upgraded.
Need to get 9,770 kB of archives.
After this operation, 91.5 MB of additional disk space will be used.
Do you want to continue [Y/n]?
...
$ sudo apt-get install php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 libonig2 libqdbm14 php5-cli php5-common
Suggested packages:
php-pear
The following packages will be REMOVED:
apache2-mpm-worker
The following NEW packages will be installed:
apache2-mpm-prefork libapache2-mod-php5 libonig2 libqdbm14 php5 php5-cli php5-common
0 upgraded, 7 newly installed, 1 to remove and 84 not upgraded.
Need to get 5,707 kB of archives.
After this operation, 16.3 MB of additional disk space will be used.
Do you want to continue [Y/n]?
I think If you install php module for apache and php 5 with above apt-get command will enable the php support for apache but still this also depends on the linux version you are using on,because there seems to be some bugs in php.ini file on apache integration in ubuntu(v10.04) but ubuntu(v12.04)seems fine

HHVM with FastCGI install error

I'm getting below error when I try to install using apt-get install -y --force-yes hhvm-fastcgi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
hhvm-fastcgi : Depends: hhvm (>= 2.3.0)
E: Unable to correct problems, you have held broken packages.
I also did apt-get install hhvm but I'm getting:
Reading package lists... Done
Building dependency tree
Reading state information... Done
hhvm is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
Is there a way to get this fastcgi working with HHVM?
As of the 3.0.0 release, there is no longer a hhvm-fastcgi package. Instead, the hhvm only supports FastCGI. You can find instructions on how to install that package for your distro here.
Once it has been successfully installed, it'll provide a short blurb on some commands that will then go and configure your web server (either Nginx or Apache) to use HHVM, or you can follow almost any php-fpm installation instructions, just replacing php-fpm with hhvm.
If you don't get the blurb (as you're already running the latest version), you can see it here.
As per the official documentation, we'll install HHVM, which also
includes the ability to start HHVM with FastCGI.
Pre-requisites
$ sudo apt-get update
$ sudo apt-get install -y unzip vim git-core curl wget build-essential python-software-properties
Installing HHVM
$ wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
$ echo deb http://dl.hhvm.com/ubuntu precise main | sudo tee /etc/apt/sources.list.d/hhvm.list
$ sudo apt-get update
$ sudo apt-get install -y hhvm
You can also try to do this before installing HHVM:
sudo add-apt-repository -y ppa:mapnik/boost
Additional:
This page has a comment about a vagrant box that comes pre installed with HHVM.
If you are interested: HHVM-Vagrant

Categories