5

I tried to install Laravel with Composer on my Debian 9 terminal with

composer global require laravel/installer

But I get the following errors:

Using version ^3.0 for laravel/installer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/installer v3.0.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - laravel/installer v3.0.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for laravel/installer ^3.0 -> satisfiable by laravel/installer[v3.0.0, v3.0.1].

  To enable extensions, verify that they are enabled in your .ini files:
    - /opt/lampp/etc/php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, deleting ./composer.json.

I tried to install the PHP ext Zip extension with:

apt-get install php7.4-zip

and

apt-get install php-zip

and also edit the php.ini file uncommenting the following lines:

extension=php_zip.dll
extension="zip.so"

But nothing works and I have the same errors...

9
  • did you try to restart apache after the install ? Commented Jan 21, 2020 at 14:42
  • I installed PHP with XAMPP and used /opt/lampp/xampp restart but doesn't works the installation of Laravel Commented Jan 21, 2020 at 14:48
  • second step is to check if the extension is really installed php -m you can as well grep php -m | grep zip Commented Jan 21, 2020 at 14:53
  • On uncommenting both lines, you've enabled both the Windows and the Unix extension... have you checked through the given lines that you've edited the proper files? Commented Jan 21, 2020 at 14:54
  • 1
    third step would be cheking if composer is using the actual php version, for that you can try php composer.phar, where composer.phar is its path, i had it one time using a different php version, so it could be a reason as well Commented Jan 21, 2020 at 14:55

2 Answers 2

3
  • Make sure to restart the webserver after the change
  • php -m to list the compiled modules
  • it happened to me once (on plesk) that composer was using a different php version than to use php itself
  • You could try php composer.phar(the location of that) and check the results

If Installing laravel is what matters here

here are some possible solutions

  • composer create-project laravel/laravel [dir]
  • or git clone https://github.com/laravel/laravel.git then cd to that directory, usually laravel, so cd laravel then composer install
Sign up to request clarification or add additional context in comments.

3 Comments

Why should one restart the webserver? PHP on the shell does not use any webserver
@NicoHaase because one doesn't really know much about the remote environment, so it would be useful to try it
I posted my answer with the lines in terminal down, I don't know what to do...
3

I had the same problem as you.

I could see that I was lacking the zip extension by doing

php -m

I did

apt search php | grep zip

to see if there was a package I could install, I found php-zip, so I did

sudo apt install php-zip

after which php -m showed zip in the list.

Then I tried the command to install Laravel again

composer global require laravel/installer

and it succeeded.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.