【问题标题】:Unable to use the Symfony installer because of an https error由于 https 错误,无法使用 Symfony 安装程序
【发布时间】:2017-08-12 15:34:12
【问题描述】:

我正在尝试学习 Symfony ...开始阅读教程,似乎最好的入门方法是使用 Symfony 安装程序中的构建。所以我在我的 USB 密钥驱动器上安装了 uwamp。它似乎工作正常,因为当我导航到 localhost 时会打开测试页面。

PHP 版本设置为 7.0.3,当我打开 Windows 控制台并键入 php -v 时,选择了正确的版本,因此我设置了正确的全局路径。

我已经检查了所有 PHP 和 Apache 模块,并确保我拥有所有必需的东西,包括 OpenSSL 和 curl 以及所有其他推荐的东西。实际上,它们都已经预先配置了 uwamp 安装(谢谢)

所以当我尝试使用 Symfony 命令时,我得到了这样的结果:

[GuzzleHttp\Exception\RequestException]
Error creating resource: [message] fopen(): Unable to find the wrapper "https" - did you forget to enable it when y
ou configured PHP?
[file] phar://J:/UwAmp/www/symfony/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 406
[message] fopen(https://get.symfony.com/symfony.version): failed to open stream: Invalid argument
[file] phar://J:/UwAmp/www/symfony/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 406
[message] Undefined variable: http_response_header
[file] phar://J:/UwAmp/www/symfony/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 407

我不明白……我确实设置了正确的 OpenSSL……我还需要做什么?我什至手动检查了 ini 文件并确保删除了半列。

【问题讨论】:

  • 你能试试运行composer.phar diag吗?
  • J:\UwAmp\www>php composer.phar diag 无法打开输入文件:composer.phar
  • 你在 J:\UwAmp\www 中有 composer.phar 对吗?

标签: php https openssl symfony-3.1 uwamp


【解决方案1】:

好的,经过大量的挖掘,我终于找到了解决问题的方法。

  1. 确保使用 GUI 启用 openssl
  2. 找到uwamp-directory/php/php-x.x.x/php_uwamp.ini
  3. 将内容复制到同一目录下名为 php.ini 的新文件中
  4. 将 extension_dir 和 zend_extension 替换为完整路径而不是 {} vars

就我而言:

extension_dir = "J:\UwAmp\bin\php\php-7.0.3\ext"
zend_extension = "J:\UwAmp\bin\php\php-7.0.3\zend_ext\php_xdebug.dll"

据我了解,Windows CLI 不使用 php_uwamp.ini 文件,而是使用默认值。使用正确的扩展路径创建一个名为 php.ini 的文件将使其工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-31
    • 1970-01-01
    • 2021-06-01
    • 2011-02-21
    • 1970-01-01
    相关资源
    最近更新 更多