在Windows上安装composer时出现SSL错误

时间:2014-08-19 07:22:22

标签: php ssl laravel composer-php

当我尝试在Windows上安装composer时,我收到了这个错误:

"Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers
are impossible. If possible you should enable it or recompile php 
with --with-openssl"

有谁知道如何解决这类错误?

另外你应该知道我在apache服务器上启用了ssl。

4 个答案:

答案 0 :(得分:2)

在CLI中尝试php -m以检查是否列出了openssl。然后使用php --ini

检查您的php.ini位置

您可能正在修改错误的php.ini。

答案 1 :(得分:1)

要检查的另一件事是还应启用以下行。

  

include_path =“.; c:\ php \ includes”

     

extension_dir =“./”

     

extension_dir =“ext”

也遇到了同样的问题。

快乐撰写:) :) :) :) :) :))

答案 2 :(得分:0)

从所有php.ini启用openssl
;extension=php_openssl.dll => extension=php_openssl.dll

如果您正在使用wamp,那么在php.ini文件中更改后不要忘记重新启动所有服务

答案 3 :(得分:0)

我有带有xampp 3.0.12(php5.4)的Windows 10。我无法安装作曲家。我尝试了以下对我有用的步骤。

  1. https://getcomposer.org/installer下载安装程序脚本
  2. 将其保存在名为composer-setup.php的文件中
  3. 在vscode或子行代码编辑器中打开composer-setup.php。
  4. 将所有https替换为http并保存文件。
  5. 在命令提示符下执行以下3个步骤。

    php -r“ if(hash_file('sha384','composer-setup.php')==='a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd'er'er {er' -setup.php');}回显PHP_EOL;“

    php composer-setup.php

    php -r“ unlink('composer-setup.php');”

  6. 中提琴!成功安装Composer后,可以运行:php composer.phar。

谢谢

相关问题