How do I install ZipArchive and DOMDocument?

Linode Staff

How do I install ZipArchive and DOMDocument PHP extensions?

2 Replies

Hey there

So this is a tough one to answer without some more information. What have you tried so far and what happened during these attempts?

I am going to attach some guides I was able to find that may help. It seems that in a lot of cases these two extensions can come as a part of PHP 7.0

PHP 7 on Ubuntu

Installing PHP Zip extension

Installing DOMDocument

I hope this helps. Let us know if you have any other questions. Also any other info you can provide may help the Community guide you in the right direction.

-Blake

If anyone is looking to enable ZipArchive(or any other PHP extension, such as mb-string) on Centos7 with cPanel/WHM this can be done through EasyApache in WHM.

If you wish to install the extension via the command-line you can perform the following steps, just be sure to use a matching PHP version.

php --version

Find your corresponding PHP version module:

yum search ea- | grep zip
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


yum install ea-phpXX-php-zip.x86_64

You'll then need to restart Apache for the changes to take effect:

systemctl restart httpd.service

More information about this process can be found here.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct