调用未定义的函数openssl_decrypt [英] Call to undefined function 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.
-
在
- 检查
extension=php_openssl.dll
. - 检查
extension_dir
是否在php.ini
中正确指向.
php.ini
中启用了- Check
extension=php_openssl.dll
is enabled in yourphp.ini
. - Check
extension_dir
is pointed correctly inphp.ini
.
如果您最近升级了php版本而不是Apache,则可能无法正确读取libeay32.dll
和ssleay32.dll
,这是openssl的要求,或者发生某些版本不匹配的情况.
If you have recently upgraded your php version and not your Apache then it might be a possibility that correct libeay32.dll
and ssleay32.dll
are not being read which is a requirement for openssl or some version mismatch is happening.
- 获取最新版本的
libeay32.dll
和ssleay32.dll
或从php目录中说C:\php
复制它,并覆盖Apache \ bin中说C:\Apache24\bin
目录中的文件.
- Get latest version of
libeay32.dll
andssleay32.dll
or copy it from your php directory sayC:\php
and overwrite the files in your Apache\bin sayC:\Apache24\bin
directory.
希望这会有所帮助.
这篇关于调用未定义的函数openssl_decrypt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!