Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv()
up vote
-1
down vote
favorite
I got a Fatal Error with my code and trace everywhere and couldn't find the problem of my code, here is the my code:
<?php
class Hash
public static function make($string, $salt = '')
return hash('sha256', $string . $salt);
public static function salt($length)
return mcrypt_create_iv($length);
public static function unique()
return self::make(uniqid());
I keep getting this error=>
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in C:xampphtdocslearnphptutorclassesHash.php:8 Stack trace: #0 C:xampphtdocslearnphptutorregister.php(37): Hash::salt(32) #1 main thrown in C:xampphtdocslearnphptutorclassesHash.php on line 8
php
add a comment |
up vote
-1
down vote
favorite
I got a Fatal Error with my code and trace everywhere and couldn't find the problem of my code, here is the my code:
<?php
class Hash
public static function make($string, $salt = '')
return hash('sha256', $string . $salt);
public static function salt($length)
return mcrypt_create_iv($length);
public static function unique()
return self::make(uniqid());
I keep getting this error=>
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in C:xampphtdocslearnphptutorclassesHash.php:8 Stack trace: #0 C:xampphtdocslearnphptutorregister.php(37): Hash::salt(32) #1 main thrown in C:xampphtdocslearnphptutorclassesHash.php on line 8
php
1
Possible duplicate of Reference - What does this error mean in PHP?
– miken32
Nov 11 at 3:24
1
According to the manual php.net/manual/en/function.mcrypt-create-iv.php 'mcrypt_create_iv()' is removed as of PHP version 7.2. TypePHP -v
at your command line to find out what version you have.
– bcperth
Nov 11 at 3:39
^ should actually usephpinfo()
as comand line php could be a diffirent version
– IdontDownVote
Nov 11 at 4:17
Thank you, but I now found I solution to the problem, after they remove themcrypt_create_iv
function, they replace it withrandom_bytes
function.
– Safianu Mohammed
Nov 11 at 17:32
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I got a Fatal Error with my code and trace everywhere and couldn't find the problem of my code, here is the my code:
<?php
class Hash
public static function make($string, $salt = '')
return hash('sha256', $string . $salt);
public static function salt($length)
return mcrypt_create_iv($length);
public static function unique()
return self::make(uniqid());
I keep getting this error=>
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in C:xampphtdocslearnphptutorclassesHash.php:8 Stack trace: #0 C:xampphtdocslearnphptutorregister.php(37): Hash::salt(32) #1 main thrown in C:xampphtdocslearnphptutorclassesHash.php on line 8
php
I got a Fatal Error with my code and trace everywhere and couldn't find the problem of my code, here is the my code:
<?php
class Hash
public static function make($string, $salt = '')
return hash('sha256', $string . $salt);
public static function salt($length)
return mcrypt_create_iv($length);
public static function unique()
return self::make(uniqid());
I keep getting this error=>
Fatal error: Uncaught Error: Call to undefined function mcrypt_create_iv() in C:xampphtdocslearnphptutorclassesHash.php:8 Stack trace: #0 C:xampphtdocslearnphptutorregister.php(37): Hash::salt(32) #1 main thrown in C:xampphtdocslearnphptutorclassesHash.php on line 8
php
php
asked Nov 11 at 2:45
Safianu Mohammed
13
13
1
Possible duplicate of Reference - What does this error mean in PHP?
– miken32
Nov 11 at 3:24
1
According to the manual php.net/manual/en/function.mcrypt-create-iv.php 'mcrypt_create_iv()' is removed as of PHP version 7.2. TypePHP -v
at your command line to find out what version you have.
– bcperth
Nov 11 at 3:39
^ should actually usephpinfo()
as comand line php could be a diffirent version
– IdontDownVote
Nov 11 at 4:17
Thank you, but I now found I solution to the problem, after they remove themcrypt_create_iv
function, they replace it withrandom_bytes
function.
– Safianu Mohammed
Nov 11 at 17:32
add a comment |
1
Possible duplicate of Reference - What does this error mean in PHP?
– miken32
Nov 11 at 3:24
1
According to the manual php.net/manual/en/function.mcrypt-create-iv.php 'mcrypt_create_iv()' is removed as of PHP version 7.2. TypePHP -v
at your command line to find out what version you have.
– bcperth
Nov 11 at 3:39
^ should actually usephpinfo()
as comand line php could be a diffirent version
– IdontDownVote
Nov 11 at 4:17
Thank you, but I now found I solution to the problem, after they remove themcrypt_create_iv
function, they replace it withrandom_bytes
function.
– Safianu Mohammed
Nov 11 at 17:32
1
1
Possible duplicate of Reference - What does this error mean in PHP?
– miken32
Nov 11 at 3:24
Possible duplicate of Reference - What does this error mean in PHP?
– miken32
Nov 11 at 3:24
1
1
According to the manual php.net/manual/en/function.mcrypt-create-iv.php 'mcrypt_create_iv()' is removed as of PHP version 7.2. Type
PHP -v
at your command line to find out what version you have.– bcperth
Nov 11 at 3:39
According to the manual php.net/manual/en/function.mcrypt-create-iv.php 'mcrypt_create_iv()' is removed as of PHP version 7.2. Type
PHP -v
at your command line to find out what version you have.– bcperth
Nov 11 at 3:39
^ should actually use
phpinfo()
as comand line php could be a diffirent version– IdontDownVote
Nov 11 at 4:17
^ should actually use
phpinfo()
as comand line php could be a diffirent version– IdontDownVote
Nov 11 at 4:17
Thank you, but I now found I solution to the problem, after they remove the
mcrypt_create_iv
function, they replace it with random_bytes
function.– Safianu Mohammed
Nov 11 at 17:32
Thank you, but I now found I solution to the problem, after they remove the
mcrypt_create_iv
function, they replace it with random_bytes
function.– Safianu Mohammed
Nov 11 at 17:32
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245406%2ffatal-error-uncaught-error-call-to-undefined-function-mcrypt-create-iv%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Possible duplicate of Reference - What does this error mean in PHP?
– miken32
Nov 11 at 3:24
1
According to the manual php.net/manual/en/function.mcrypt-create-iv.php 'mcrypt_create_iv()' is removed as of PHP version 7.2. Type
PHP -v
at your command line to find out what version you have.– bcperth
Nov 11 at 3:39
^ should actually use
phpinfo()
as comand line php could be a diffirent version– IdontDownVote
Nov 11 at 4:17
Thank you, but I now found I solution to the problem, after they remove the
mcrypt_create_iv
function, they replace it withrandom_bytes
function.– Safianu Mohammed
Nov 11 at 17:32