2016-08-14 67 views
2

我開始一個關於Symfony的3教程和使用此命令創建一個新的項目時,我面臨着一個問題: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,是否有可能是問題的根源?

在此先感謝

+4

檢查此問題http://stackoverflow.com/questions/5444249/unable-to-find-the-wrapper-https-did-you-forget-to-enable-it-when-you-config – 0x13a

+0

非常感謝:) – Nathan30

回答

3

可能按你沒有安裝OpenSSL的@ 0x13a的意見。

我想XAMPP這些都是說明:

進入你C:\xampp\php\ext\php.ini文件並取消:

;延長= php_openssl.dll

如果沒有,嘗試將它添加。我相信XAMPP應該安裝openssl,但如果沒有,你可能需要研究一下。


編輯#2 - 對於Marine1

使用此命令來安裝OpenSSL:已

sudo apt-get install openssl 

然後找出哪個php.ini被使用VI PHP命令行:

php -i |grep 'Loaded Configuration File' 

然後用vi編輯上面指定的php.ini(下面是一個例子):

vi /etc/php.ini 

並進行我指出的更改。

+0

嗨Nathan30。如果這解決了問題,您是否可以單擊複選標記將其標記爲答案。有兩種方法可以回答答案,一種方法是在回答有幫助時單擊向上箭頭,另一種方式是通過選中標記表示已解決問題。謝謝! –

+0

那麼Linux用戶呢? ;) – Marine1

+0

Hi @ Marine1,你有什麼Linux發行版?我的回答解決了OP在Windows上的問題。 –