The Zip PHP extension is not installed. Please install it and try again. Laravel

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

Solving the "Zip PHP Extension is not installed" Error When Installing Laravel

As a senior developer, I often encounter these kinds of dependency errors when setting up new frameworks like Laravel. It can be incredibly frustrating when you've followed the instructions precisely, yet the system throws an error about a missing extension. Don't worry; this issue is extremely common, especially when working in Linux environments like Ubuntu.

This post will walk you through exactly why you are seeing this message and provide the definitive steps to resolve it so you can successfully start your Laravel journey.

Understanding the Error: Why Does Laravel Need the Zip Extension?

When you run commands like laravel new test, Laravel relies on various underlying PHP capabilities to perform file operations, especially when setting up project structures or handling asset bundling. The error message, "The Zip PHP extension is not installed," indicates that a critical component—the PHP ZIP extension—is missing from your current PHP installation.

The ZIP extension is fundamental for compressing and decompressing files. Frameworks like Laravel often use this capability internally to manage vendor files, packages, or potentially asset compilation during the initial setup process. Without it, the installer cannot perform these necessary file operations, halting the process.

You are using PHP 7.4.7 on Ubuntu 16.04, and ensuring all required modules are present is the first step to a stable development environment.

The Solution: Installing the Missing Extension on Ubuntu

The error you encountered suggests that while you installed many related packages, the specific package responsible for enabling the ZIP functionality might have been missed or needs a direct invocation on your specific system configuration.

Here is the most reliable way to ensure the ZIP extension is correctly installed and enabled for PHP 7.4 on Ubuntu:

Step 1: Verify and Install the Extension

Instead of relying solely on a broad list, let's focus specifically on installing the zip package and ensuring it hooks into your existing PHP installation.

Run the following command in your terminal:

sudo apt update
sudo apt install -y zip unzip

Explanation:

  • sudo apt update: This refreshes your package list, ensuring you are pulling the latest information about available software.
  • sudo apt install -y zip unzip: This command installs the necessary utilities. While zip is the primary utility, installing unzip alongside it ensures comprehensive support for file compression operations that PHP relies upon.

Step 2: Verify the Installation

After the installation completes successfully, you should verify that the ZIP extension is now recognized by your PHP environment. You can do this by checking the installed modules:

php -m

Look through the output for zip. If it appears in the list, the extension is properly loaded.

Best Practices for Laravel Development Environments

Setting up a robust development environment is crucial for smooth development. When you are starting with Laravel, remember that a well-configured foundation saves immense time later on. A stable PHP installation is the bedrock of this setup.

As you continue your learning path and build larger applications, ensuring your dependencies are correctly managed—whether through system packages or using tools like Composer (which manages PHP dependencies for Laravel projects)—is key. For deeper insights into building robust applications, always refer to resources that emphasize solid architectural foundations, much like those promoted by organizations focusing on modern development practices, such as those found at laravelcompany.com.

Conclusion

The error regarding the missing ZIP extension is a common system configuration hurdle, not a bug in Laravel itself. By systematically installing the underlying system utility (zip) via apt-get and verifying its presence, you resolve the dependency issue immediately. Once this is sorted, you should be able to run your command successfully:

laravel new test

Keep experimenting, stay persistent, and remember that every error encountered is a lesson learned on the path to becoming a skilled developer!