我开始编写有关 Symfony 3 的教程,在使用以下命令创建新项目时遇到问题:
php symfony.phar new 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://C:/xampp/htdocs/symfony.phar/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://C:/xampp/htdocs/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 406
[message] Undefined variable: http_response_header
[file] phar://C:/xampp/htdocs/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 407
[GuzzleHttp\Ring\Exception\RingException]
Error creating resource: [message] fopen(): Unable to find the wrapper "https" - did you forget to enable it when y
ou configured PHP?
[file] phar://C:/xampp/htdocs/symfony.phar/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://C:/xampp/htdocs/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 406
[message] Undefined variable: http_response_header
[file] phar://C:/xampp/htdocs/symfony.phar/vendor/guzzlehttp/ringphp/src/Client/StreamHandler.php
[line] 407
我本地安装了 PHP7,这可能是问题的根源吗?
提前致谢
可能根据 @0x13a 的评论,您没有安装 openssl 。
我认为 XAMPP 中的说明如下:
进入你的C:\xampp\php\ext\php.ini
文件并取消注释:
;扩展名=php_openssl.dll
如果没有,请尝试添加它。我相信 XAMPP 应该安装 openssl,但如果没有,您可能需要研究一下。
编辑 #2 - 对于 Marine1
使用以下命令安装 openssl:
sudo apt-get install openssl
然后通过命令行 vi php 找出正在使用哪个 php.ini:
php -i |grep 'Loaded Configuration File'
然后用vi编辑上面指定的php.ini(下面是一个例子):
vi /etc/php.ini
并进行我指示的更改。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)