Amjad
Amjad

Reputation: 2100

RuntimeException The Zip PHP extension is not installed

I'm a newbie in Linux I just installed composer and laravel...

but when i run the laravel new project i get the following error:

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

I don't know how to install that extension...

please help

Upvotes: 16

Views: 25164

Answers (9)

Fadel ellah ERRAMI
Fadel ellah ERRAMI

Reputation: 19

For Windows users, to enable the Zip extension in the php.ini file, you just need to uncomment the line by removing the semicolon before extension=zip .

Before: ;extension=zip

After: extension=zip

,first you have to create file php.ini, using this command php --ini

Upvotes: 0

NPC
NPC

Reputation: 63

You can use php-zip or php-zip7.x package from apt. Such as:

sudo apt-get install php-zip

Many packages in apt have a default version such as php-zip then explicit version(s). In order to search apt for packages you can always use

apt-cache search keyword

Or in this example specifically either

apt-cache search zip
apt-cache search php-zip

Which will allow you to find the php-zip and php-zip7.4 (at the time of writing this comment) package to install.

Very useful command to when you're trying to satisfy some dependency and cannot find the package name.

Upvotes: 0

Arnoldkk
Arnoldkk

Reputation: 597

use this sudo apt-get install php-zip The php version will be sorted out by the system.

Upvotes: 1

Atiar Talukdar
Atiar Talukdar

Reputation: 746

installing on CentOS

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

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

Upvotes: 0

This is outdate using brew doctor and brew cleanup. Brew doctor will give you some fixes that will help you install laravel.

composer global require laravel/installer\n && brew install php

Upvotes: 0

user6419437
user6419437

Reputation:

I got the same issue and tried to install the extension with the command sudo apt install php7.0-zip but still got the same error. I finally solved it with sudo apt install php-zip

Upvotes: 6

Harry
Harry

Reputation: 971

for php 7.0

sudo apt-get install php7.0-zip

for php 7.1

sudo apt-get install php7.1-zip

and so on!

Upvotes: 13

Aryeh Beitz
Aryeh Beitz

Reputation: 2078

I was using php7.0-zts.
The solution was to uninstall all the ZTS packages and revert to the regular php7.0 packages.

Upvotes: 1

Devin Norgarb
Devin Norgarb

Reputation: 1159

Try type into the command line:

sudo apt-get install php7.0-zip

Verify from any route with:

dd(get_loaded_extensions());

This worked for me, good luck.

Upvotes: 26

Related Questions