在EC2实例启用OpenSSL的 [英] Enabling OpenSSL on EC2 instance

查看:101
本文介绍了在EC2实例启用OpenSSL的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为我的EC2服务器上安装OpenSSL的,这样我可以摆脱此特定错误的:

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)

但是做了一些研究,我发现,我需要让东西在我的php.ini文件,之后,我不能让任何事情,涉及到OpenSSL的,我需要进行调整,如下所示:

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:

;延长= php_openssl.dll 扩展= p​​hp_openssl.dll

那是当我意识到我需要安装为我的php.ini文件的扩展,有延长我启用它,但是我不知道怎么我的EC2实例的服务器上安装OpenSSL的。谁能给我任何指导?

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?

推荐答案

试着用安装:

 yum install php-openssl

如果您需要安装Apache模块还,如果上述didnt的命令龙头安装它做的:

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

yum install mod_ssl 

然后检查php.ini文件的扩展名是avaible,如果你不知道你使用的是你可以把一个PHP文件中的下列哪个php.ini中:

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();

由于您使用的是Linux找到该文件的行波纹管,如果它不存在将其添加到末尾:

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

之后重新启动Apache服务器

After that restart the apache server with

 service httpd restart

您应该已经安装了SSL,可以用一个php文件如下检查:

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

phpinfo();

这篇关于在EC2实例启用OpenSSL的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆