Enabling OpenSSL in WAMP

孤人 提交于 2019-11-27 18:12:58
gsziszi

Wampserver with apache 2.4.4 released with wrong openssl files. All the things to do is: download and install the 1.0.1e openssl from here: http://slproweb.com/products/Win32OpenSSL.html

Then find these files in the installed directory:

bin\openssl.cfg

bin\libeay32.dll

bin\ssleay32.dll

bin\openssl.exe

Stop the apache server. at first, save a BACKUP of them. Then overright these files in your apache directory:

conf\openssl.cnf->rename the cfg here

bin\libeay32.dll

bin\ssleay32.dll

bin\openssl.exe

Restart the server. Solved.

The path to php.ini [in case you want that for composer] is C:\wamp\bin\php\php5.4.x\php.ini . This file is not the same as the one that you have if you navigate through the Wamp tray icon

Go there and remove the semicolon as @milesstewart88 says

milesstewart88

Just uncomment your openssl extension in your php.ini file.

Eg. ;extension=php_openssl.dll

Remove the semicolon so it's like this.

extension=php_openssl.dll

That should work; it worked for me.

baikho

On a Wampserver with Apache 2.4.4 and this worked for me:
Assuming you already created a dir with SSL key and certificate for example at: c:/wamp/OpenSSL

uncomment in 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>

edit in 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>

uncomment in php.ini: extension=php_openssl.dll

See How I did manage this..

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

Place your certificates & key on a separate folder say "wwwssl"

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

Create a virtual host for desired server see eg: below

<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>                                  

Like milesstewart88 said - uncoment line extension=php_openssl.dll in php.ini file.

Doing that from wamp menu wont work - which can misslead from real problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!