调用未定义的函数openssl_decrypt [英] Call to undefined function openssl_decrypt

查看:379
本文介绍了调用未定义的函数openssl_decrypt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试通过POST向具有以下行的脚本发出请求时:

When I try to make a request with POST to a script that has this line:

$decrypted_data = openssl_decrypt($encrypted_data, 'AES-256-CBC', $key);

我收到以下错误:

致命错误:在第11行的mypath/usuario_webservice.php中调用未定义的函数openssl_decrypt()

Fatal error: Call to undefined function openssl_decrypt() in mypath/usuario_webservice.php on line 11

经过一些研究,常见的原因是输入错误的函数名称或未在我的Web服务器上安装openssl扩展名.事实证明,它是在与支持人员核对后安装的.那么,我还要寻找什么?

After some research the common reasons would be entering the wrong name for the function or the openssl extension not being installed on my web server. It turns out that it is installed as I checked with the support. So, what else should I be looking for?

推荐答案

我正在发布此消息,因为它可能对某些人有帮助.

I am posting this as it might be helpful to some.

    php.ini中启用了
  • 检查extension=php_openssl.dll.
  • 检查extension_dir是否在php.ini中正确指向.
  • Check extension=php_openssl.dll is enabled in your php.ini.
  • Check extension_dir is pointed correctly in php.ini.

如果您最近升级了php版本而不是Apache,则可能无法正确读取libeay32.dllssleay32.dll,这是openssl的要求,或者发生某些版本不匹配的情况.

If you have recently upgraded your php version and not your Apache then it might be a possibility that correct libeay32.dlland ssleay32.dll are not being read which is a requirement for openssl or some version mismatch is happening.

  • 获取最新版本的libeay32.dllssleay32.dll或从php目录中说C:\php复制它,并覆盖Apache \ bin中说C:\Apache24\bin目录中的文件.
  • Get latest version of libeay32.dlland ssleay32.dll or copy it from your php directory say C:\php and overwrite the files in your Apache\bin say C:\Apache24\bin directory.

希望这会有所帮助.

这篇关于调用未定义的函数openssl_decrypt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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