Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I install zipArchive on PHP 7.2 with CentOS 7?

Tags:

php

I am trying to install ziparchive and domdocument on nginx web server that has the latest WordPress. In order to run Avada theme, I need these two on the local CentOS 7 test server. I am searching for an answer for the past 3 days. What shoud I do?

Here is a partial list of "yum list installed:"

php-common.x86_64                   7.2.3-2.el7.remi               @remi-php72<BR>
php-fpm.x86_64                      7.2.3-2.el7.remi               @remi-php72<BR>
php-json.x86_64                     7.2.3-2.el7.remi               @remi-php72<BR>
php-mysqlnd.x86_64                  7.2.3-2.el7.remi               @remi-php72<BR>
php-pdo.x86_64                      7.2.3-2.el7.remi               @remi-php72<BR>
php72.x86_64                        1.0-1.el7.remi                 @remi-safe<BR>
php72-php-cli.x86_64                7.2.3-2.el7.remi               @remi-safe<BR>
php72-php-common.x86_64             7.2.3-2.el7.remi               @remi-safe<BR>
php72-php-json.x86_64               7.2.3-2.el7.remi               @remi-safe<BR>
php72-php-mbstring.x86_64           7.2.3-2.el7.remi               @remi-safe<BR>
php72-php-pear.noarch               1:1.10.5-6.el7.remi            @remi-safe<BR>
php72-php-process.x86_64            7.2.3-2.el7.remi               @remi-safe<BR>
php72-php-xml.x86_64                7.2.3-2.el7.remi               @remi-safe<BR>
php72-runtime.x86_64                1.0-1.el7.remi                 @remi-safe<BR>

unzip.x86_64                        6.0-16.el7                     @base<BR>
like image 943
STINGRAY Avatar asked Mar 31 '18 03:03

STINGRAY


People also ask

How do you add a ZIP extension?

Install Chrome extension from file Vision RPA Selenium IDE. In the case of Kantu, you can get the older version directly from the archive. So the process starts with the Chrome extension as ZIP archive. Step 2: Select "Load Unpacked" (extension) and point it to the extension folder - and you are done!


3 Answers

php-json.x86_64 7.2.3-2.el7.remi @remi-php72

php72-php-json.x86_64 7.2.3-2.el7.remi @remi-safe

Looks like your installation is a mess, you have installed half of the php- packages (base packages) and half of the php72-php- (SCL packages)

Read the FAQ about Difference between php-* and php##-php-* packages ?

php-fpm.x86_64 7.2.3-2.el7.remi @remi-php72

As you are using FPM as base package from remi-php72, you need zip extension from the same repository (which is probably not enabled, chech with yum repolist)

Drop the unneeded packages

yum remove php72\*

As explained by the wizard, enable the repository permanently to ensure all extensions will be pulled from it

yum-config-manager --enable remi-php72
yum install php-pecl-zip

echo "extension=zip.so" >> /etc/php.d/zip.in

Never do this, each package provides its configuration file to enable the provided extension.

like image 160
Remi Collet Avatar answered Sep 28 '22 08:09

Remi Collet


try yum search zip |grep -i php and install with package name came back

like image 40
tringuyen Avatar answered Sep 28 '22 07:09

tringuyen


This method works for me: First type: yum search zip |grep -i php then it will appear you all modules related to ZIP extensions with various of PHP version like so:

ea-php54-php-zip.x86_64 : A module for PHP applications that need to handle .zip
ea-php55-php-zip.x86_64 : A module for PHP applications that need to handle .zip
ea-php56-php-zip.x86_64 : A module for PHP applications that need to handle .zip
ea-php70-php-zip.x86_64 : A module for PHP applications that need to handle .zip
ea-php71-php-zip.x86_64 : A module for PHP applications that need to handle .zip
ea-php72-php-zip.x86_64 : A module for PHP applications that need to handle .zip
ea-php73-php-zip.x86_64 : A module for PHP applications that need to handle .zip

select whatever version you working with by: yum install ea-php72-php-zip.x86_64 finally, restart the Apache through service httpd restart

like image 25
Imad Oulhou Avatar answered Sep 28 '22 08:09

Imad Oulhou