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…
2
Answers
php -m
to list the compiled modulesphp
itselfphp composer.phar(the location of that)
and check the resultsIf Installing laravel is what matters here
here are some possible solutions
composer create-project laravel/laravel [dir]
git clone https://github.com/laravel/laravel.git
thencd
to that directory, usually laravel, socd laravel
thencomposer install
I had the same problem as you.
I could see that I was lacking the zip extension by doing
I did
to see if there was a package I could install, I found
php-zip
, so I didafter which
php -m
showedzip
in the list.Then I tried the command to install Laravel again
and it succeeded.