Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

evandrobm@gmail.com's avatar

Zip PHP extension problem in Ubuntu (PHP7)

I'm trying to install Laravel on Ubuntu 14.04, i installed php 7, not php 5, when i try to run "laravel new project" i got the message...

[RuntimeException] The Zip PHP extension is not installed. Please install it and try again.

How can i solve this? Thanks!

0 likes
11 replies
mehany's avatar
mehany
Best Answer
Level 13

The below should install zip extension on your Ubuntu server

 sudo apt-get install php7.0-zip 

Verify from any route with

 dd(get_loaded_extensions());
48 likes
evandrobm@gmail.com's avatar

I had tried pecl install zip, but it returns me a '"make" error', now i used the apt-get and it works, installed the extension and "laravel new Project" works.

Thank You!

Lomas-Joshi's avatar

when i try to install zip by "sudo apt-get install php7.0-zip " command it shows below error.

The following packages have unmet dependencies: php7.0-zip : Depends: php7.0-common (= 7.0.4-7ubuntu2.1) but 7.0.6-13+donate.sury.org~wily+1 is to be installed E: Unable to correct problems, you have held broken packages.

djmsuman's avatar

@Lomas-Joshi Your problem is not with PHP7.0-Zip package. It says you have some broken dependencies. Try sudo apt-get install -f to resolve. I think you have already solved this issue since the comment is 4 months older. Though I'm sharing if someone get this issue in future.

Kentoy's avatar

I have something like this when i issued laravel new blog the output are down below ? how to enable this extensions sir ?

Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Your requirements could not be resolved to an installable set of packages.

Problem 1 - Installation request for laravel/framework v5.3.19 -> satisfiable by laravel/framework[v5.3.19]. - laravel/framework v5.3.19 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. Problem 2 - Installation request for phpunit/phpunit 5.6.1 -> satisfiable by phpunit/phpunit[5.6.1]. - phpunit/phpunit 5.6.1 requires ext-dom * -> the requested PHP extension dom is missing from your system.

To enable extensions, verify that they are enabled in those .ini files: - /etc/php/5.6/cli/php.ini - /etc/php/5.6/cli/conf.d/10-mysqlnd.ini - /etc/php/5.6/cli/conf.d/10-opcache.ini - /etc/php/5.6/cli/conf.d/10-pdo.ini - /etc/php/5.6/cli/conf.d/20-calendar.ini - /etc/php/5.6/cli/conf.d/20-ctype.ini - /etc/php/5.6/cli/conf.d/20-exif.ini - /etc/php/5.6/cli/conf.d/20-fileinfo.ini - /etc/php/5.6/cli/conf.d/20-ftp.ini - /etc/php/5.6/cli/conf.d/20-gd.ini - /etc/php/5.6/cli/conf.d/20-gettext.ini - /etc/php/5.6/cli/conf.d/20-iconv.ini - /etc/php/5.6/cli/conf.d/20-json.ini - /etc/php/5.6/cli/conf.d/20-mcrypt.ini - /etc/php/5.6/cli/conf.d/20-mysql.ini - /etc/php/5.6/cli/conf.d/20-mysqli.ini - /etc/php/5.6/cli/conf.d/20-pdo_mysql.ini - /etc/php/5.6/cli/conf.d/20-phar.ini - /etc/php/5.6/cli/conf.d/20-posix.ini - /etc/php/5.6/cli/conf.d/20-readline.ini - /etc/php/5.6/cli/conf.d/20-shmop.ini - /etc/php/5.6/cli/conf.d/20-sockets.ini - /etc/php/5.6/cli/conf.d/20-sysvmsg.ini - /etc/php/5.6/cli/conf.d/20-sysvsem.ini - /etc/php/5.6/cli/conf.d/20-sysvshm.ini - /etc/php/5.6/cli/conf.d/20-tokenizer.ini - /etc/php/5.6/cli/conf.d/20-zip.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode. Application ready! Build something amazing.

rosk's avatar

How can I install ZipArchive in laravel 5.3 using composer?

Thanks.

racl101's avatar

If you are running Ubuntu 14.04 and have installed PHP 5.6 from the ppa:ondrej/php PPA then you can install Zip Extension like this:

sudo apt-get install php5.6-zip

observer's avatar

sudo apt-get install php-zip then restart apache

1 like

Please or to participate in this conversation.