Monday, February 26, 2018

mcrypt for PHP 7

PHP 7.2 completely deprecated mcrypt. I found this out trying to get some third-party software to work. However, I did come across a solution, that worked for me at least.

1. Based on OS & PHP setup, install the following...

2. Use the following code in a PHP include / main PHP class for your app...

Formatted with CodeFormatter

 // Composer loading for PHPseclib  
 require_once 'autoload.php';  
 $loader = new \Composer\Autoload\ClassLoader();  
 $loader->addPsr4('phpseclib\\', __DIR__ . 'vendor/phpseclib/phpseclib/phpseclib');  
 $loader->register();  
   
 // Mcrypt-enablement  
 require_once 'vendor/mollie/polyfill-libsodium/bootstrap.php';  
 require_once 'vendor/phpseclib/mcrypt_compat/lib/mcrypt.php';  

No comments:

Post a Comment