Search code examples
phpxamppphp-5.5blenc

Fatal error: blenc_compile: Module php_blenc was expired. Please buy a new license key or disable the module. in Unknown on line 0


When i run blenc encrypted file it gives error:

Fatal error: blenc_compile: Module php_blenc was expired. Please buy a new license key or disable the module. in Unknown on line 0

These Steps i'm followed for blenc usage:

  1. I installed latest version of blenc from blenc-1.1.4b in xampp

  2. then created a file encoder.php with content:

    $source_code = file_get_contents("testcode.php"); $redistributable_key = blenc_encrypt($source_code, "encrypt.php"); $key_file = ini_get('blenc.key_file'); file_put_contents($key_file, $redistributable_key . "\n", FILE_APPEND);

  3. then created a file testcode.php with content:

    echo "hello";

  4. then i encoded the file named as testcode.php to encrypt.php.

And While run it, I got error given above.


Solution

  • php_blenc need an absolute path for key_file like this in php.ini:

    blenc.key_file = "d:/php/blenckeys"
    

    and for license key error build blenc yourself and in source files blenc_protect.h

    ...
    
    #define BLENC_PROTECT_EXPIRE "99-99-9999"
    
    ... 
    

    replace with

    ...
    
    #define BLENC_PROTECT_EXPIRE "01-01-9999"
    
    ...