20

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>
Rahul
  • 18,271
  • 7
  • 41
  • 60
STINGRAY
  • 301
  • 1
  • 2
  • 3

7 Answers7

31

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.

Remi Collet
  • 6,198
  • 1
  • 20
  • 25
  • THIS WORKED! I think you meant "yum remove php72\-" Anyway, it unistalled all PHPs, and I reinstalled it, then my problems are gone. Thank you so much! – STINGRAY Apr 04 '18 at 19:12
29

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

tringuyen
  • 791
  • 5
  • 5
9

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

Imad Oulhou
  • 159
  • 2
  • 9
8

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

tringuyen
  • 791
  • 5
  • 5
  • * base: mirror.steadfast.net * epel: mirror.cs.princeton.edu * extras: mirrors.lga7.us.voxel.net * remi-safe: mirror.team-cymru.org * updates: mirror.team-cymru.org No package php-pecl-zip.x86_64 available. Error: Nothing to do WHAT AM I MISSING? – STINGRAY Mar 31 '18 at 03:49
  • try yum search zip |grep -i php and install with package name came back. – tringuyen Mar 31 '18 at 04:05
7

This worked for me!

yum install php-pecl-zip
apachectl restart
Jared Forth
  • 1,577
  • 6
  • 17
  • 32
5

I was able to resolve this issue via the following:

yum install yum-utils
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install remi-release-7.rpm
yum-config-manager --enable remi-php72
yum install php72-php-pecl-zip
echo "extension=/opt/remi/php72/root/usr/lib64/php/modules/zip.so" >> /etc/php.d/zip.ini

The issue was due to using the remi repo which doesn't place the module in one of the default locations PHP expects. Setting the absolute path to zip.so in the extension variable under /etc/php.d/zip.ini fixes the issue.

You can find the location of zip.so on your system via the following if the above path doesn't work:

updatedb
locate zip.so
Banana
  • 159
  • 2
  • 5
  • Or you could add the zip module into the PHP modules directory `sudo cp /opt/remi/php74/root/usr/lib64/php/modules/zip.so /usr/lib64/php/modules/` ` – turrican_34 Sep 05 '20 at 17:02
1

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

like - sudo yum install ea-php73-php-zip.x86_64

Atiar Talukdar
  • 668
  • 11
  • 22