How can I install ziparchive on php 7.4? - apache

I am running Virtuamin on centos 7, I am unable to install ziparchive on php 7.4, but when I switch to php 7.2, it works. I need php 7.4 to work because it is faster and wordpress script need 7.3+ to work effectively.

sudo apt-get install php7.4-zip
This works in ubuntu 18.04

Maybe you would like to take a look on this post:
https://www.cloudbooklet.com/upgrade-php-version-to-php-7-4-on-ubuntu/
Basically, it tells you to:
Add PPA for PHP 7.4
Add the ondrej/php which has PHP 7.4 package and other required PHP extensions.
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Then you can install the extension
sudo apt install php7.4-zip
Or install all the commonly used ones:
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y

I am on Debian 9, which does not ship with PHP7.4, but it can be installed if you add the repository from Sury.
sudo apt install ca-certificates apt-transport-https
wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
After that, I ran this with success:
apt install php7.4-zip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
php7.4-zip
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 20.5 kB of archives.
After this operation, 94.2 kB of additional disk space will be used.
Get:1 https://packages.sury.org/php stretch/main amd64 php7.4-zip amd64 7.4.7-1+ 0~20200612.18+debian9~1.gbp671911 [20.5 kB]
Fetched 20.5 kB in 0s (149 kB/s)
Selecting previously unselected package php7.4-zip.
(Reading database ... 107553 files and directories currently installed.)
Preparing to unpack .../php7.4-zip_7.4.7-1+0~20200612.18+debian9~1.gbp671911_amd 64.deb ...
Unpacking php7.4-zip (7.4.7-1+0~20200612.18+debian9~1.gbp671911) ...
Processing triggers for libapache2-mod-php7.4 (7.4.7-1+0~20200612.18+debian9~1.g bp671911) ...
Setting up php7.4-zip (7.4.7-1+0~20200612.18+debian9~1.gbp671911) ...
Creating config file /etc/php/7.4/mods-available/zip.ini with new version
Processing triggers for php7.4-fpm (7.4.7-1+0~20200612.18+debian9~1.gbp671911) . ..
NOTICE: Not enabling PHP 7.4 FPM by default.
NOTICE: To enable PHP 7.4 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php7.4-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Processing triggers for libapache2-mod-php7.4 (7.4.7-1+0~20200612.18+debian9~1.g bp671911) ...
Processing triggers for php7.4-cgi (7.4.7-1+0~20200612.18+debian9~1.gbp671911) . ..
Processing triggers for php7.4-cli (7.4.7-1+0~20200612.18+debian9~1.gbp671911) . ..

This is how I installed it on my ubuntu:-
For PHP
sudo apt-get install php7.0-zip
For Centos
You can try: yum install php-pecl-zip.x86_64
Try installing that and enabling it by running: echo "extension=zip.so" >> /etc/php.d/zip.ini
NOTE: Make sure to restart your server after install the above
sudo /etc/init.d/apache2 restart or sudo service nginx restart

Related

Difficulties in installing Qlik Catalog related SW

I am installing Qlik Catalog SW on Linux Read Hat Enterprise 7.9 following the instructions of the installation guide.
I have got the first problem in Tomcat Installation. Basically, I am not able to connect to Tomcat with the browser.
Below is a detailed list of commands I have used.
I have tried it using Firefox.
When trying to install Chrome I got other issues.
Any hints?
*** Installing Chrome ***
# sudo yum install glib
# sudo yum list glibc
# sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
# sudo yum -y install redhat-lsb libXScrnSaver
# sudo yum -y localinstall google-chrome-stable_current_x86_64.rpm
>>>>>>>>>>>>>>>>>>>>>>>
Error: Package: google-chrome-stable-95.0.4638.54-1.x86_64 (/google-chrome-stable_current_x86_64)
Requires: libc.so.6(GLIBC_2.18)(64bit)
<<<<<<<<<<<<<<<<<<<<<<<
*** Installing Tomcat ***
Install wget (if not already installed):
# sudo yum install -y wget
Become the service account user:
# sudo su - qdcuser
Download Apache Tomcat and extract the file in usr/local/qdc:
$ cd /usr/local/qdc
$ wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.38/bin/apache-tomcat-9.0.38.tar.gz
$ tar -xvf apache-tomcat-9.0.38.tar.gz
Overwrite <tomcat home>/conf/server.xml with the version expanded from the Qlik Catalog zip file:
$ cp /tmp/podium/config/tomcat9-server.xml /usr/local/qdc/apache-tomcat-9.0.38/conf/server.xml
Opening ports 8080 and 8443:
# sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
# sudo firewall-cmd --zone=public --permanent --add-port=8443/tcp
# sudo systemctl restart firewalld.service
Setup Apache Tomcat as a service to automatically start when Linux restarts:
# sudo cp /tmp/podium/config/tomcat.service /etc/systemd/system/
# sudo systemctl daemon-reload
# sudo systemctl enable tomcat.service
Edit the file /etc/systemd/system/tomcat.service to insert the correct user and group names:
# sudo nano /etc/systemd/system/tomcat.service
User=qdcuser
Group=qdcgroup
Start Tomcat manually:
$ cd /usr/local/qdc/apache-tomcat-9.0.38
$ ./bin/startup.sh
Browse to the following URL to verify that Tomcat is running:
https://localhost:8443
>>>>>>>>>>>>>>>>>>>>
Unable to connect
Firefox can’t establish a connection to the server at localhost:8443.
<<<<<<<<<<<<<<<<<<<<<
I too see this issue.. Here is what I think the reason might be..
rpm -qf /usr/lib64/libc.so.6
glibc-2.17-325.el7_9.x86_64
glibc is 2.17 on RHEL 7.9 The developers at google should know this which means it is a bug.
Or. They should provide that library as part of their package and statically link it.
Short answer. For now, until Google figures it out and fixes, I might either remove the package, or skip that package.
To skip..
sudo yum -y update --exclude google-chrome-stable*
To remove... Well.. "sudo yum -y remove google-chrome-stable"
An alternative until google resolve the problem is:
sudo yum update --skip-broken
This can install all updates and ignore chrome

How to install gearman extension in php7 running on ubuntu 18.04

I am currently required to setup the new server running php7.2 and the server will have many background process for sending emails to customer. the recommendation I got was to use Gearman Job Server.
I have been searching but seems to have only post about gearman-job-server with php5 and below.
The process of installing Gearman Job Server with php7 will be covered in like 4 steps
Install and update the Gearman PPA
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:gearman-developers/ppa
sudo apt-get update
Install Gearman Job Server and some other required components and tools
sudo apt-get install gearman-job-server libgearman-dev php7.0-dev php-pear wget unzip re2c
sudo apt-get upgrade
Download, compile the gearman pecl module and add to php.ini
cd /tmp/
sudo wget https://github.com/wcgallego/pecl-gearman/archive/master.zip
unzip master.zip
cd pecl-gearman-master
sudo phpize
./configure
sudo make
sudo make install
echo "extension=gearman.so" | sudo tee /etc/php/7.0/mods-available/gearman.ini
sudo phpenmod -v ALL -s ALL gearman
Restart webserver or PHP FPM
sudo service php7.0-fpm restart
sudo service apache2 restart
If you are running a different version of PHP make sure you make the appropriate changes to the commands or directories mentioned above. ie “/etc/php/7.0/” to “/etc/php/7.1/” etc.
Thanks to techearl.com for their tutorial which can be found
Here
The answer by Ruberandinda Patience is correct and will work but since the gearman pecl module is packaged for Ubuntu there is a much simpler way to achieve the same thing:
apt install gearman-job-server php-gearman

Installing libapache2-mod-php7.1

I installed Apache 2.4.27 and PHP 7.1.7 from source, but I don't find a tip about how to install libapache2-mod-php7.1 or the required module.
How can I install libapache2-mod-php7.1 (or similar) to Apache 2 located under /user/local/apache2?
I have to install it on Debian 8.8 Jessie.
Basically it should be installed during installation of PHP:
sudo apt-get install php7.1
...
The following NEW packages will be installed:
libapache2-mod-php7.1 libssl1.0.2 php-common php7.1 php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-readline
So first check if it is already installed:
dpkg -l | grep libapache2-mod-php7.1
ii libapache2-mod-php7.1 7.1.7.retag-1+0~20170711133844.5+jessie~1.gbp5284f4 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
In case it is not installed the following command should work fine:
sudo apt-get install libapache2-mod-php7.1
If it will fail check if it is available in repo:
apt-get update
apt-cache search libapache2-mod-php7.1
I used deb.sury.org for php 7.1:
apt-get install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ jessie main" > /etc/apt/sources.list.d/php.list
apt-get update

phpredis extension doesn't work, unable to load 'redis.so'

I installed nginx, php, php-fpm, php-pecl-redis by yum.
All of them work but the last one.
When I run /usr/sbin/php-fpm, I got this:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/redis.so' - /usr/lib/php/modules/redis.so: undefined symbol: igbinary_unserialize in Unknown on line 0
I don't know what igbnary_unserialize means and how to fix it.
I checked the redis.so file under right path. I add extension=redis.so to php.ini
PHP version: 5.3.3
PhpRedis version: 2.2.7
I had the same issue. I'm on Ubuntu 16.04 LTS. Running sudo apt-get install php-igbinary resolved the issue for me. I have other issues, but that's what solved this one.
For people who are upgrading their php from 7.0 to 7.4 like me, and not able to get php-redis working. These are the steps I used after following the answers above.
1) remove Redis
sudo apt purge php-redis
2) Install Igbinary
sudo apt-get install php-igbinary
3) Install php-redis again
sudo apt-get install php-redis
I did the steps above because it seems only php7.0 is recognising the php-redis install but not the currently enabled php7.4
I also recommend removing other versions of PHP if you have should your problem continue unsolved.
Probably an issue with igbinary, is this installed? (try for example: cat /etc/php.d/igbinary.ini).
Here you can find and install igbinary
Related to this bug https://bugs.launchpad.net/ubuntu/+source/php-redis/+bug/1762935
You should remove php-redis from packages:
apt purge php-redis , and install it via pecl install redis
You should add "extension=redis.so" to php.ini
and remove redis from config.d in your php directory:
rm /etc/php/7.2/fpm/conf.d/#20-redis.ini
and
rm /etc/php/7.2/cli/conf.d/#20-redis.ini
restart php fpm and you will see that problem solved
On Ubuntu 20 and PHP 7.4
I did this and it worked :
sudo apt purge php-redis
sudo apt intall php-redis php7.4-redis
TEST redis server :
$ php --ri redis
or
$ redis-cli ping
$ redis-cli info stats
just resolve the same problem:
php-pecl-redis installed by yum will cause this problem.
so you need to install the php-redis manually. wget the package and phpize - configure - make ....

unable to install redis 2.7+ on ubuntu 12.04

I am new to redis. and I just followed cli to install redis sudo apt-get install redis.
but the install server version is 2.2.12 . If I want to update this version and I want to install redis 2.7 + then how can I do this thing, please help. I am working on ubuntu 12.04
You can install a Personal Package Archive to get the latest version. A popular one seems to be https://launchpad.net/~rwky/+archive/redis
edit: The one above is no longer maintained. Try https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server instead.
sudo apt-get -y install python-software-properties
sudo add-apt-repository -y ppa:chris-lea/redis-server
sudo apt-get -y update
sudo apt-get -y install redis-server
These commands installed the latest version for me at the time of writing.
Ubuntu repositories have the 2.2 version of Redis as you discovered. If you want the latest version, you will have to download the sources from github and install it manually.
See "Installing Redis" section in the readme over here - https://github.com/antirez/redis
Try either
sudo apt-get install redis-server
or
http://laymansite.com/install-redis-in-ubuntu-12-04/