Including OpenSSL in an EC2 Instance

I am currently trying to install openssl on my ec2 server in order to 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 several studies, it turned out that I needed to include something in the php.ini file, however I could not include anything related to OpenSSL, where I would need to make this setup:

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

That's when I realized that I need to install the extension for my php.ini file in order to have this extension for me to enable it, however I do not know how to install OpenSSL on my ec2 instance server. Can anyone offer me any recommendations?

+4
source share
2 answers

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

Try yum search opennsll if you don't see it

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

+2
source

Try installing with:

  yum install php-openssl 

If you also need to install the apache module, and if the command is not specified above, follow these steps:

 yum install mod_ssl 

Then check if php.ini supports the extension, if you do not know which php.ini you are using, you can put the following in your php file:

  echo php_ini_loaded_file(); 

Since you are using linux, find the line below in the file if it does not add it to the end:

 extension=openssl.so 

After that restart the apache server using

  service httpd restart 

You must have ssl installed and you can check it with the following php file:

 phpinfo(); 
+2
source

Source: https://habr.com/ru/post/1501762/


All Articles