


PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 的解决办法
PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 的解决方法
我也是PHP新手,通过w3cschool了解了一下php基本原理之后就开写了。但仍是菜鸟。
先不管3DES加密的方法对不对,方法都是网上的,在运行的时候报了个错,把小弟整死了。找来找去终于自己摸出了方法。
1 |
|
代码可以不看,就看里面的一句:$td = mcrypt_module_open( MCRYPT_3DES, '', MCRYPT_MODE_CBC, '');报错的就是他。
我搜寻了一大堆解决方法,正确的方法应该是(仅用于windows系统哦):
当运行php的服务器端缺少libmcrypt.dll时使用函数mcrypt_module_open进行解密会出现此错误。
在服务器上做如下设置可解决。
到网上下载一个php的mcrypt模块安装包,只需要libmcrypt.dll文件即可(一般官网上下载的,php目录下已经有的)
1.将libmcrypt.dll复制到system32目录或php安装目录下的extensions目录下
2.将libmcrypt.dll复制到apache安装目录的bin目录下
3.到windows目录下找到php.ini文件,打开它
4.找到; Directory in which the loadable extensions (modules) reside.
extension_dir = "./" 如:extension_dir = "D:\php5\ext"
这两行,要使extension_dir指向的目录下能找到libmcrypt.dll,或系统path下有libmcrypt.dll
5.找到;Windows Extensions 项下面的;extension=php_mcrypt.dll这一行和;extension=php_iconv.dll(我的没有,省略了)这两行,去掉前面的分号
ps:刚开始看网上的解决方法,有的说修改php安装目录下的php.ini,但是修改后是没用的。一定要修改windows目录下的php.ini!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c
