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

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

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Installing ZIP Archive and DOMDocument on PHP 7.2 with CentOS 7

You are facing a common deployment hurdle: the Avada theme requires zip and dom extensions, but your standard PHP installation lacks them. The log output you provided shows that you have successfully installed PHP 7.2 via REMI (@remi-php72), which is excellent because it provides up-to-date packages on CentOS 7. However, the list confirms two missing pieces: php72-php-zip and php72-php-dom.

The solution isn't to compile from source or hunt for obscure EPEL repositories; it is strictly a matter of adding the correct REMI sub-packages that match your existing PHP version. Your current setup lists php-common, php-fpm, and php-xml as installed, but these are base modules. To enable the specific functionality required by WordPress and Avada, you need to explicitly install the extensions that sit on top of them.

Run the following command to install the missing dependencies:

sudo yum install php72-php-zip php72-php-dom

This single command pulls the necessary .so files into your PHP installation directory. Once the packages are installed, you must verify that PHP recognizes these new extensions. Execute php -m in your terminal to list active modules. You should now see zip and dom (or domdocument) listed alongside your existing modules like mbstring and pdo.

If the extensions appear in the module list but your WordPress site still reports that they are missing, the issue lies in PHP-FPM configuration rather than the extension installation itself. By default, REMI installs extensions into a directory designated for CLI usage, not for the web server context. You need to ensure the extensions are loaded when PHP runs as a service.

Open your php.ini file. Depending on how you installed REMI, this might be located at /etc/remi/php72/php.ini or /etc/php/7.2/fpm/php.ini. Search for lines starting with ;zip, ;dom, or ;date. Remove the leading semicolon to uncomment them:

extension=zip.so
extension=dom.so

After saving the file, restart your PHP-FPM service to apply changes without downtime. Use the following command to reload the service gracefully:

sudo systemctl reload php-fpm

If you are using Apache instead of Nginx directly managing the PHP process, ensure that mod_php is also configured to load these extensions via its own php.ini.

A critical detail when working with Avada on CentOS 7 is understanding how Nginx interacts with this stack. Nginx does not execute PHP code; it passes requests to PHP-FPM. If your nginx.conf or a virtual host file references a specific PHP socket (e.g., /var/run/php-fpm/www.sock), ensure that the user running the web server can access that socket and that the PHP-FPM pool is configured with the same user permissions as the Nginx worker processes.

Another potential pitfall involves DOMDocument. While the extension is installed, some older WordPress versions or specific theme scripts might rely on functions deprecated in newer PHP versions. Since you are on PHP 7.2, ensure your WordPress core is updated to a version compatible with that PHP release. If you encounter memory limit issues when parsing large XML files within Avada, check your memory_limit setting in the PHP configuration, as DOMDocument can be memory-intensive.

Finally, verify the installation from within the WordPress environment itself. Create a simple file named test.php in your public directory with the following content:

<?php
phpinfo();
?>

Access this file via your browser. Scroll down to the "Registered PHP Streams" section (for zip) and look for the DOM extension details. This confirms that both Nginx and PHP-FPM are seeing the extensions correctly. If everything checks out, Avada should load without errors.

Our network