我正在尝试安装 Composer 。我使用 Windows 安装程序下载它。 我的composer.json 看起来像这样
{
"require": {
"monolog/monolog": "1.2.*"
}
}
现在,当我尝试运行命令composer install时,它给出以下错误。
C:\ProgramData\Composer\bin>php composer.phar install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing monolog/monolog (1.2.1)
Downloading: 100%
Downloading: 100%
Downloading: connection...
Could not fetch http://nodeload.github.com/Seldaek/monolog/zip/1.2.1, enter your GitHub credentials to access private repos
The credentials will be swapped for an OAuth token stored in C:/Users/RUMMAN/AppData/Roaming/Composer/config.json, your password will not be stored
To revoke access to this token you can visit https://github.com/settings/applications
Username:
Password:
如果我将它们留空,则会出现以下错误
[Composer\Downloader\TransportException]
The "https://api.github.com/authorizations" file could not be downloaded: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?
failed to open stream: Invalid argument
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
顺便提一下,我已经在我的 php 设置中启用了开放 SSL。
最佳答案
如果您确实为 php CLI 启用了 openSSL,那么当您在终端中运行 php -m
时,它应该会显示。如果没有,请运行 php --ini 并编辑此命令输出中显示的 php.ini。
关于php - 安装命令在 Composer 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16979949/