This is a platform to work with different encryption algorithms in PHP
DEPRECATED This function is deprecated in PHP in PHP 7.1.0 and removed in PHP 7.2.0
Enabling mcrypt setting inside PHP.INI
Inside your php.ini file search for the line
;extension=php_mcrypt.dll
Change this line to
extension=php_mcrypt.dll
Loading the extension
Inside your php extension directory ( where all other extension dll files are stored) your dll file should be there . like this
If it is not there then you have to install the extension. Go to control panel
Control Panel > Programs > Programs and Features
Uninstall or change a program
Select PHP and go for Change
Checking php installation
We can use phpinfo() function to know the settings of our PHP installation. If mcrypt is available then we will get this while using phpinfo() .
For Linux or LAMP
Add the extension by adding this line.
extension=mcrypt.so
After this you have to restart your web server.
Checking extension status and function
We can use function_exists() to check of mycrypt functions are available or not. Similarly we can check status of extension by using extension_loaded(). Here is a sample code to know the status of mcrypt support in your PHP installation.
<?Php
if(function_exists('mcrypt_create_iv')){
echo "<br>mcrypt_create_iv function support is available ";
}else{
echo "<br>mcrypt_create_iv function support is NOT available ";
}
if (extension_loaded('mcrypt')) {
echo "<br>mcrypt support is loaded ";
}else{
echo "<br>mcrypt support is NOT loaded ";
}
?>