1

我正在尝试学习 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 文件并确保删除了半列。

4

1 回答 1

0

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

  1. 确保使用 GUI 启用 openssl
  2. 找到uwamp-directory/php/php-xxx/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 的文件将使其工作。

于 2017-03-21T06:12:44.217 回答