Laravel 5 Use of undefined constant MCRYPT_RIJNDAEL_128 错误
php artisan -V
PHP Notice: Use of undefined constant MCRYPT_RIJNDAEL_128 - assumed 'MCRYPT_RIJNDAEL_128' in /var/www/ngLav5/config/app.php on line 83
Laravel Framework version 5.0.16
gao@gao-VirtualBox:/var/www/ngLav5$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/framework v5.0.9 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.8 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.7 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.6 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.5 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.34 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.33 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.32 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.31 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.3 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.29 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.28 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.27 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.26 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.25 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.24 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.23 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.22 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.21 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.20 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.19 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.18 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.17 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.15 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.14 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.13 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.12 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.11 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.10 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework 5.0.30 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.
- Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[5.0.30, v5.0.0, v5.0.1, v5.0.10, v5.0.11, v5.0.12, v5.0.13, v5.0.14, v5.0.15, v5.0.16, v5.0.17, v5.0.18, v5.0.19, v5.0.2, v5.0.20, v5.0.21, v5.0.22, v5.0.23, v5.0.24, v5.0.25, v5.0.26, v5.0.27, v5.0.28, v5.0.29, v5.0.3, v5.0.31, v5.0.32, v5.0.33, v5.0.34, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9].
=======================================================
我的环境是 ubuntu 15.04 , php5.6解决办法:
sudo apt-get install php5-mcrypt sudo php5enmod mcrypt
sudo ln-s/etc/php5/fpm/conf.d/mcrypt.ini/etc/php5/mods-available/mcrypt.ini sudo service php5-fpm restart sudo service nginx restart # 如果使用了
apache2 请执行以下命令
sudo service
apache2restart
参考网址:http://www.kvcodes.com/2014/07/laravel-requires-mcrypt-php-extension/
https://laracasts.com/discuss/channels/general-discussion/laravel5-new-install-mcrypt-rijndael-128-notice
相关推荐
3. 错误处理“Call to undefined function: mcrypt_module_open()”:该错误表明调用的函数`mcrypt_module_open()`未被定义。原因可能有两个:一是mcrypt扩展没有安装,二是PHP配置中没有启用mcrypt扩展。 4. PHP新...
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CFB), MCRYPT_DEV_URANDOM); ``` 接着,使用`mcrypt_encrypt`加密数据: ```php $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128...
2. 调用`mcrypt_encrypt`函数,传入加密算法(MCRYPT_RIJNDAEL_256)、密钥材料、要加密的字符串以及CBC模式下的初始向量(在这里使用`md5(md5($key))`)。 3. 加密后的结果会包含一些不适用于URL的字符,所以将其...
1. 加密算法:Mcrypt支持众多加密算法,如AES(Rijndael)、DES、3DES、Blowfish等,这些算法都具有很高的安全性。 2. 工作模式:Mcrypt提供了多种工作模式,如ECB、CBC、CFB、OFB和CTR。每种模式都有其独特的加密...
数据通过 mcrypt 使用算法 MCRYPT_RIJNDAEL_256 进行加密。用法将 lib/_session.php 包含到您的项目中使用以下代码启动会话 $ session = new encryptedSession( $ secret_key );session_set_save_handler ( $ ...
return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(KEY), $code, MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND))); } public ...
$ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, 'your_data', MCRYPT_MODE_CBC, $iv); //解密 $decrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $ciphertext, MCRYPT_MODE_CBC, $iv); ``` 然而...
mcrypt_compat 用于 mcrypt 扩展的 PHP 5.x/7.x polyfill。 支持 mcrypt_compat 安装 与: composer require phpseclib/mcrypt_compat 支持的算法 rijndael-128 rijndael-192 rijndael-256 德 河豚 RC2 三重...
PHP加密和解密函数可以用来加密一些有用的字符串存放在... $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), 12); return $decrypted
使用`mcrypt_encrypt`和`mcrypt_decrypt`函数可以实现AES加密和解密,配合`MCRYPT_RIJNDAEL_128`和`MCRYPT_MODE_CBC`来指定算法和模式。 7. **密钥管理和安全性**: 为了保证安全性,密钥应当妥善存储,并且只在需要...
就像用PHP加密一样: mcrypt_encrypt ( MCRYPT_RIJNDAEL_128 , $ key , $ text , MCRYPT_MODE_ECB ); 用lua加密: local data = ' wait to be encrypted 'local key = ' 01234567890123456 ' -- length is 16local ...
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $key = 'your_key'; $ciphertext = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plain...
$key = "WANGBAOCHEN9@wHhs...$data=mcrypt_encrypt(MCRYPT_RIJNDAEL_128,$key, $data, 'ecb'); //转HEX $data = strtoupper(bin2hex($data)); //解密 //转string $data = hex2bin(strtolower($data))
主要给大家介绍了关于PHP 7.1中AES加解密方法mcrypt_module_open()替换方案的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $ciphertext = mcrypt_encrypt($algorithm, $key, $plaintext, $mode, $iv); echo "加密...
Laravel支持AES-128-CBC和AES-256-CBC两种加密方式,并且要求它们的key长度分别是16和32字节。Encrypter类还提供了一个static方法supported()来判断给定的key和cipher是否匹配。Encrypter类使用OpenSSL扩展来实现...
$decryptedtext = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, base64_decode($ciphertext), MCRYPT_MODE_CBC, $iv); echo "Decrypted text: " . $decryptedtext . "\n"; ``` 这段代码使用了AES-128(Rijndael-128...