我尝试使用Composer在我的Debian 9终端上安装Laravel。
composer global require laravel/installer
但我收到以下错误:
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.
我尝试使用以下命令安装PHP扩展Zip:
apt-get install php7.4-zip
并且
apt-get install php-zip
同时还需要编辑php.ini文件,取消以下行的注释:
extension=php_zip.dll
extension="zip.so"
但是什么都不起作用,我还是遇到了同样的错误...
php -m
,你也可以使用 grep 命令php -m | grep zip
。 - Emad Haphp composer.phar
,其中composer.phar是其路径,我曾经使用不同的PHP版本,所以这也可能是一个原因。 - Emad Hacomposer create-project laravel/laravel
安装 Laravel 吗? - Emad Ha