2013-06-27 81 views
12

我今天在Windows 7計算機上安裝了最新的WAMP(從wampserver.com)。在WAMP中啓用OpenSSL

我已經啓用SSL在PHP > PHP Extensions > php_openssl

而且Apache > Apache Modules > open_ssl

但是當我嘗試以https訪問任何內容://我得到 「問題加載頁面」。 apache_error.log說

[Thu Jun 27 16:25:08.622056 2013] [ssl:warn] [pid 4812:tid 356] AH01882: Init: this version of mod_ssl was compiled against a newer library (OpenSSL 1.0.1e 11 Feb 2013, version currently loaded is OpenSSL 1.0.1d 5 Feb 2013) - may result in undefined or erroneous behavior 


[Thu Jun 27 16:25:08.973076 2013] [ssl:warn] [pid 4812:tid 356] AH01882: Init: this version of mod_ssl was compiled against a newer library (OpenSSL 1.0.1e 11 Feb 2013, version currently loaded is OpenSSL 1.0.1d 5 Feb 2013) - may result in undefined or erroneous behavior 


[Thu Jun 27 16:25:09.356098 2013] [ssl:warn] [pid 4812:tid 356] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache] 


[Thu Jun 27 16:25:09.365099 2013] [mpm_winnt:notice] [pid 4812:tid 356] AH00455: Apache/2.4.4 (Win64) OpenSSL/1.0.1d PHP/5.4.12 configured -- resuming normal operations 

[Thu Jun 27 16:25:09.365099 2013] [mpm_winnt:notice] [pid 4812:tid 356] AH00456: Server built: Feb 22 2013 22:08:37 

[Thu Jun 27 16:25:09.365099 2013] [core:notice] [pid 4812:tid 356] AH00094: Command line: 'c:\\wamp\\bin\\apache\\apache2.4.4\\bin\\httpd.exe -d C:/wamp/bin/apache/Apache2.4.4' 

[Thu Jun 27 16:25:09.366099 2013] [mpm_winnt:notice] [pid 4812:tid 356] AH00418: Parent: Created child process 3452 

[Thu Jun 27 16:25:09.664116 2013] [ssl:warn] [pid 3452:tid 248] AH01882: Init: this version of mod_ssl was compiled against a newer library (OpenSSL 1.0.1e 11 Feb 2013, version currently loaded is OpenSSL 1.0.1d 5 Feb 2013) - may result in undefined or erroneous behavior 

[Thu Jun 27 16:25:09.954132 2013] [ssl:warn] [pid 3452:tid 248] AH01882: Init: this version of mod_ssl was compiled against a newer library (OpenSSL 1.0.1e 11 Feb 2013, version currently loaded is OpenSSL 1.0.1d 5 Feb 2013) - may result in undefined or erroneous behavior 

[Thu Jun 27 16:25:10.327154 2013] [ssl:warn] [pid 3452:tid 248] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache] 


[Thu Jun 27 16:25:10.339154 2013] [mpm_winnt:notice] [pid 3452:tid 248] AH00354: Child: Starting 150 worker threads. 

回答

23

帶有錯誤的openssl文件發佈的apache 2.4.4 Wampserver。所有要做的事情就是:下載並從這裏安裝1.0.1e的OpenSSL:http://slproweb.com/products/Win32OpenSSL.html

然後發現在安裝目錄下這些文件:

斌\ openssl.cfg

斌\的libeay32.dll

斌\ ssleay32.dll

斌\ openssl.exe

停止Apache服務器。首先,保存一份備份。然後overright這些文件在Apache目錄:

的conf \ openssl.cnf->重命名這裏的CFG

斌\的libeay32.dll

斌\ ssleay32.dll

斌\ OpenSSL的。 exe

重新啓動服務器。解決了。

+2

我不知道如何或爲什麼,但這只是現在讓我的服務器崩潰。 – Corne

+0

我已經完成了,我的服務器也崩潰了 – Thermech

+0

@George D的建議爲我工作。這不幸的是沒有。我的服務器沒有崩潰,雖然 – kakoma

23

只取消您的php.ini文件中的openssl擴展的註釋。

例如, ; extension = php_openssl.dll

刪除分號,就像這樣。

extension = php_openssl.dll

這應該工作;它爲我工作。

+0

謝謝@ milestewart88。它修復了這個問題。 – Riz

37

php.ini的路徑[如果你想要作曲者]是C:\ wamp \ bin \ php \ php5.4.x \ php.ini。此文件是不一樣的,如果你通過WAMP的托盤圖標

轉到導航那裏,並刪除分號作爲@ milesstewart88說

+0

謝謝,它工作。 –

+4

如果您面對Composer的這個問題,這是要走的路。 – Isuru

+0

謝謝你很多... –

1

看我怎麼管理這個,你有..

uncomment below line from <WEBroot>/bin/apache/Apache2.x/conf/httpd.conf 

LoadModule ssl_module modules/mod_ssl.so 

      & 

Include conf/extra/httpd-ssl.conf 

將您的證書上一個單獨的文件夾&鍵說: 「wwwssl」

AND GOT TO <WEBroot>/bin/apache/Apache2.x/conf/extra/httpd-ssl.conf 

創建所需的服務器虛擬主機見,例如:下面

<VirtualHost _default_:443> 
    DocumentRoot "<WEBroot>/www/" 
    ServerName localhost 
    SSLEngine on 
    SSLCertificateFile "<WEBroot>/wwwssl/webserver.cert" 
    SSLCertificateKeyFile "<WEBroot>/wwwssl/webserver.key" 

    <FilesMatch "\.(cgi|shtml|phtml|php)$"> 
     SSLOptions +StdEnvVars 
    </FilesMatch> 
</VirtualHost>         
3

在一個Wampserver阿帕奇2.4.4和這工作對我來說:
假設你已經創建了SSL密鑰和證書目錄,例如在:c:/wamp/OpenSSL

取消註釋httpd.conf中

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so 
LoadModule log_config_module modules/mod_log_config.so 
LoadModule setenvif_module modules/mod_setenvif.so 
LoadModule ssl_module modules/mod_ssl.so 

# Secure (SSL/TLS) connections 
<IfModule ssl_module> 
    Include conf/extra/httpd-ssl.conf 
</IfModule>` 

編輯在的httpd-ssl.conf中

SSLSessionCache  "shmcb:c:/wamp/OpenSSL/logs/ssl_scache(512000)" 

<VirtualHost _default_:443> 
    DocumentRoot "c:/wamp/www" 
    ServerName localhost:443 
    ErrorLog "c:/wamp/logs/error.log" 
    TransferLog "c:/wamp/logs/access.log" 
    SSLCertificateFile "c:/wamp/OpenSSL/certs/server.crt" 
    SSLCertificateKeyFile "c:/wamp/OpenSSL/certs/server.key" 
    <Directory "c:/wamp/www"> 
     SSLOptions +StdEnvVars 
    </Directory> 
    CustomLog "c:/wamp/logs/ssl_request.log" \ 
     "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" 
</VirtualHost>` 

取消註釋php.iniextension=php_openssl.dll

1

就像milesstewart88說的 - uncoment line extension = php_openssl.dll在php.ini文件中。

這樣做來自wamp菜單不會工作 - 這可以從真正的問題導致錯誤。