由于 https 错误,无法使用 Symfony 安装程序

Unable to use the Symfony installer because of an https error

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

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 文件并确保删除了分号。

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

  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 的文件将使其工作。