【问题标题】:Bundling ioncube loader to the application将 ioncube 加载器绑定到应用程序
【发布时间】:2014-03-13 10:41:19
【问题描述】:

我想知道是否可以创建一个加载器文件来处理加载 ioncube 加载器。通常的做法是,编码后的文件会尝试检测 ioncube loader,如果找不到则抛出错误:

if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');if(function_exists('dl')){@dl($__ln);}if(function_exists('_il_exec')){return _il_exec();}$__ln='/ioncube/'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return _il_exec();}echo('Site error: the file <b>'.__FILE__.'</b> requires the ionCube PHP Loader '.basename($__ln).' to be installed by the website operator. If you are the website operator please use the <a href="http://www.ioncube.com/lw/">ionCube Loader Wizard</a> to assist with installation.');exit(199);

根据托管环境,插入 ioncube 加载程序,例如通过将其声明为 ZendExtension 的 php.ini 文件。 是否可以将 ZendExtenion 的加载直接移植到 php 文件并将加载程序捆绑到 php 文件而不是安装 ioncube 加载程序?

【问题讨论】:

    标签: php apache ioncube


    【解决方案1】:

    不是真的。 PHP 曾经有一个名为 dl() 的函数,它可以即时安装 PHP 模块,这就是 ionCube 编码文件开头的代码使用它的“运行时加载”机制。加载程序可以与应用程序捆绑在一起,并且应用程序通常无需任何安装更改即可运行,这很棒。 PHP 5.2.5 中的一些更改对这种机制产生了一些影响,但 dl() 在 PHP 5.3 中确实变得不那么有用了,因为它从一些 SAPI 中删除了。该机制仍然适用于某些服务器,但现在通常需要安装 php.ini。

    【讨论】:

    • 我不知道提供一个引导 php 脚本来安装/增强一个 php.ini 文件来解决这个问题是否是个好主意?
    • 这样的 PHP 脚本不太可能具有创建 php.ini 文件的写入权限,因此通常这是不可能的。有一个 ionCube Loader Wizard 脚本,它可以就要进行的编辑提供建议,还可以下载一个编辑后的 ​​php.ini 文件以进行安装。现在还有一个 ionCube Loader Installer,它可以通过 FTP 或 SSH 将必要的 Loader 部署到本地或远程服务器。可以访问目标服务器,安装程序可以根据需要创建和/或编辑 php.ini 文件,建议使用。安装程序还可以创建支持票以寻求帮助。
    • 写入权限可能是个问题,但主要问题是安装 ioncube 编码软件的人不想被任何 ioncube loader 的安装方式所困扰。假设您有(例如在 CMS 中)包含主要 index.php 的常用目录,则只需将 php.ini 文件放在同一目录中。
    • 我的想法是为那些可能编写 php.ini 的客户简化安装过程。我将尝试创建一种引导加载程序来确定是否已经安装了 ioncube,否则尝试安装它,如果失败,将抛出“早期”错误消息。
    猜你喜欢
    • 1970-01-01
    • 2013-01-10
    • 1970-01-01
    • 1970-01-01
    • 2013-11-30
    • 2011-04-17
    • 1970-01-01
    • 2013-06-02
    • 2013-10-13
    相关资源
    最近更新 更多