如何在PHP中使用BLENC?

前端之家收集整理的这篇文章主要介绍了如何在PHP中使用BLENC?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个testcode.PHP文件需要编码:
<?PHP
    $hello = "Hello World!";
?>

我创建了文件encode.PHP来加密和测试该文件

<?PHP
    /* read the PHP source code */
    $source_code = file_get_contents("testcode.PHP");

    /* create the encrypted version */
    $redistributable_key = blenc_encrypt($source_code,"encrypt.PHP");

    /* read which is the key_file */
    $key_file = ini_get('blenc.key_file');

    /* save the redistributable key */
    file_put_contents($key_file,$redistributable_key,FILE_APPEND);

    include 'encrypt.PHP';
    echo $hello;
?>

但是当我运行encode.PHP时,我收到了这些错误

Warning: blenc_compile: Validation of script ‘encrypt.PHPFailed.
MD5_FILE: 910e6a45f806ba3dc42830839971cb53
MD5_CALC: c38a6b2f389267a272ea656073a463ed in
C:\xampp\htdocs\PHPEncode\encode.PHP on line 14

Fatal error: blenc_compile: Validation of script ‘encrypt.PHPFailed,
cannot execute. in C:\xampp\htdocs\PHPEncode\encode.PHP on line 14

帮我解决一下,谢谢!

猜你在找的PHP相关文章