Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()
D:\wamp64\cyage\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php
- *@paramstring $cipher
- *@returnstring
- */
- public static function generateKey($cipher)
- {
- return random_bytes($cipher == 'AES-128-CBC' ? 16 : 32);
- }
- /**
- *Encrypt the given value.
- *
- *@param mixed $value
- *@parambool $serialize
- *@returnstring
- *
- *@throws \Illuminate\Contracts\Encryption\EncryptException
- */
- public function encrypt($value, $serialize = true)
- {
- $iv = random_bytes(openssl_cipher_iv_length($this->cipher));
- //First we will encrypt the value usingOpenSSL.Afterthisis encrypted we
- // will proceed to calculating a MAC for the encrypted value so that this
- // value can be verified later as not having been changed by the users.
- $value = \openssl_encrypt(
- $serialize ? serialize($value): $value,
- $this->cipher, $this->key,0, $iv
- );
- if($value ===false){
- thrownewEncryptException('Could not encrypt the data.');
- }
- // Once we get the encrypted value we'll go ahead and base64_encode the input
- // vector and create the MAC for the encrypted value so we can then verify
- // its authenticity. Then, we'll JSON the data into the "payload" array.
- $mac = $this->hash($iv = base64_encode($iv), $value);
- $json = json_encode(compact('iv','value','mac'));
Arguments
"Call to undefined function Illuminate\Encryption\openssl_cipher_iv_length()"
1條評論
已解决 但是只能编辑问题删除不了了,出错原因是php扩展配置冲突了,删除个不需要的环境变量,在重新运行下版本