简体   繁体   中英

Enabling OpenSSL on EC2 instance

I am currently trying to install openssl on my ec2 server so that I can get rid of this particular error:

 stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14094410:SSL routines:func(148):reason(1040)

After doing some research I found out that I would need to enable something in my php.ini file, however, I cannot enable anything that relates to OpenSSL where I would need to make an adjustment like so:

from ;extension=php_openssl.dll to extension=php_openssl.dll

Thats when I realised that I need to install an extension for my php.ini file to have that extension for me to enable it, however I do not know how to install OpenSSL on my ec2 instance server. Can someone offer me any guidance?

I believe you would use yum install openssl on your server.

Try yum search opennsll if you dont see it

They have instructions here for install openssl another way: http://docs.aws.amazon.com/IAM/latest/UserGuide/InstallCert.html

Try installing with:

 yum install php-openssl

If you need to install the apache module also and if the command above didnt's intalled it do:

yum install mod_ssl 

Then check if php.ini has the extension avaible , if you don't know which php.ini you are using you can put the following on a php file:

 echo php_ini_loaded_file();

Since you are using linux find the line bellow on the file, if it's not there add it to the end:

extension=openssl.so

After that restart the apache server with

 service httpd restart

You should have ssl installed and can check it with the following on a php file:

phpinfo();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM