我想安装一些 yii2 扩展并想在 yii2 框架中使用它们。使用 Composer 时出现错误。
此外,我尝试手动添加扩展名并将其内容添加到 composer.json 中仍然没有任何效果。
一些命令包括 composer.phar 文件名,我的主项目存储库中没有这个文件。我尝试使用 composer 命令手动添加 composer.phar 但它仍然没有运行。
当我运行这个命令时,我得到了错误。
composer require dmstr/yii2-adminlte-asset "^2.1"
我收到了这个错误
Cannot create cache directory /home/kaushalendra/.composer/cache /repo/https---asset-packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/kaushalendra/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/kaushalendra/.composer/cache/files/, or directory is not writable. Proceeding without cache ./composer.json has been updated Cannot create cache directory /home/kaushalendra/.composer/cache /repo/https---asset-packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/kaushalendra/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache Cannot create cache directory /home/kaushalendra/.composer/cache/files/, or directory is not writable. Proceeding without cache 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- codeception/base 2.5.6 requires ext-curl * -> the requested PHP extension curl is missing from your system. - codeception/base 2.5.6 requires ext-curl * -> the requested PHP extension curl is missing from your system. - codeception/base 2.5.6 requires ext-curl * -> the requested PHP extension curl is missing from your system. - Installation request for codeception/base (locked at 2.5.6, required as ^2.4.0) -> satisfiable by codeception/base[2.5.6]. To enable extensions, verify that they are enabled in your .ini files: - /etc/php/7.3/cli/php.ini - /etc/php/7.3/cli/conf.d/10-opcache.ini - /etc/php/7.3/cli/conf.d/10-pdo.ini - /etc/php/7.3/cli/conf.d/20-calendar.ini - /etc/php/7.3/cli/conf.d/20-ctype.ini - /etc/php/7.3/cli/conf.d/20-exif.ini - /etc/php/7.3/cli/conf.d/20-fileinfo.ini - /etc/php/7.3/cli/conf.d/20-ftp.ini - /etc/php/7.3/cli/conf.d/20-gettext.ini - /etc/php/7.3/cli/conf.d/20-iconv.ini - /etc/php/7.3/cli/conf.d/20-json.ini - /etc/php/7.3/cli/conf.d/20-phar.ini - /etc/php/7.3/cli/conf.d/20-posix.ini - /etc/php/7.3/cli/conf.d/20-readline.ini - /etc/php/7.3/cli/conf.d/20-shmop.ini - /etc/php/7.3/cli/conf.d/20-sockets.ini - /etc/php/7.3/cli/conf.d/20-sysvmsg.ini - /etc/php/7.3/cli/conf.d/20-sysvsem.ini - /etc/php/7.3/cli/conf.d/20-sysvshm.ini - /etc/php/7.3/cli/conf.d/20-tokenizer.ini You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode. Installation failed, reverting ./composer.json to its original content.
I've seen somewhere that using this command it will work but getting this error.
composer global require "fxp/composer-asset-plugin:1.0.0-beta4"
并得到了这个错误
[ErrorException] file_put_contents(./composer.json): failed to open stream: Permission denied require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...`