2010-08-13 86 views
8

检查我用下面的代码方法:最佳,如果Ioncube公司装载机安装

<?php 
if(extension_loaded("IonCube Loader")) {  
    // Yes 
} 
else { 
    // No 
} 
?> 

我只是担心,这会不会每个服务器因工作启用Ioncube公司。这看起来很标准,但我从来没有需要检查过。这是检查的最佳方法,还是有更好的方法,我应该使用?

+0

我很抱歉,但有没有一点这个?如果您尝试在未加载IonCube脚本的服务器上运行该脚本,则该脚本将无法工作,并且会收到错误消息。 – NullUserException 2010-08-13 13:34:10

+8

是的,有一点。我正在运行脚本从服务器下载编码脚本并运行它。如果IonCube未启用,则整个应用程序将失败。检查IonCube可以保存我的服务器请求并防止您提到的错误消息。 – jdp 2010-08-13 14:53:50

+0

对我来说,检查它比查看日志时更容易,因为空白屏幕... – erm3nda 2015-05-01 20:20:22

回答

8

如果没有安装扩展,这将返回false,所以据我所知,这是检查扩展是否可用的正确方法。

另一种选择是使用get_loaded_extensions()。这会返回一个包含可用扩展名的数组。你可以检查这个数组是否包含你想要的扩展名。

+1

$ gefunden = false; 的foreach(get_loaded_extensions()为$数=> $ EXTENSION_NAME) { IF((strpos(用strtolower($ EXTENSION_NAME), “Ioncube公司”))===假){// 无能为力 } 其他 { $ gefunden = true; } } – 2013-05-23 12:05:58

1

另一种方法是

<?php 
phpinfo() 
?> 

和附加模块标题下面的内容,你应该能够看到

Ioncube公司装载机

0

其实我使用SSH的大部分东西,包括文件复制。 当我需要检查ionCube加载器对我来说更简单的方法,它只是php -m

由于字母顺序,Zend模块列在最下面。

我的输出(最后2行): [Zend Modules] the ionCube PHP Loader

对于我使用过的其他选项php -m | grep -v grep | grep MODULENAME。 如果已加载列出,否则您将变空。 (除非你忘记了grep -v grep管道)。

+0

由于ionCube加载器首先是一个PHP引擎扩展,您也可以在那里使用php -v和grep。 – Nick 2015-05-01 20:59:28

1

这里有最新的编码器V9.0加密的PHP代码(PHP 5.6/7.0),如果Ioncube公司装载机工作,你应该看到文本“工作”,如果你看到了PHP的日志空白页检查:

<?php //0046b 
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); 

?> 
HR+cPx6tTyKRWKphuWtYvXZumJL99w6eqPcw8RguzcdITTB7WMCLNusEXyi1ot1iTgoc8y+lkgal 
weKJYPcyEXz2sBTUIeIHQN7vfrMG/Ys05+GSnrFlOfwMdT2vSUzgGklS7q+TPV6jMAtLBIdSi/iY 
vfUB+Kooide9x8xN1lkZ3GKNJHS0RXQXHEtXPJ6BGuBw34zozLdp1vDRasmOCERhww6Ic2D8gpFD 
gUiOhgsx6jvgIfXU6nWArCcZDyYjA+owXjguuiL+VJFurIhudMJprcXoQK5mv7JzzWN1gPskCSld 
IjjPQuDbgsG8swBRL/l22DW0/CMxuYzl1jfhxc6bbrShp5JHB/9A6GXyusbLWdQjsOIIZOdIvaXq 
O4t8BAwatZ4aenKJ3cXFt+Ns9ElRZN8l6M/iBG83OcbzsDjxKsPtdcYzumohoHjKML0dAWw9cS87 
S+IZaxiWYURWvJbGMNH+plFCa6YKAI9ghmH3zT9HwWAOMcBtffeMr8CTTbrdSido8V+az8ZkMS6U 
jQ5C9rCR8+oIxaKNxmv53eyIpxOx+XTr4Thh4grecMeLpOOm1U72ryXi0odClC0Ab3uGpu/lzNrj 
oEg7XrSVOn7hS+VJ9khwj3s1zg1OVyrS2TTrvTIsw6h1xbKCitG9rRwPp/fv31voi7MC3K4= 

这里PHP代码编码与传统编码器8.3(PHP 5.6及以下):

<?php //0046b 
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); 

?> 
HR+cPp7q/tHOKq74dpvDQdk0enKwrkMD5yeF5eIiq+jd6h+ygyi99Yw9v+skX6plOCkD0S6vxDVT 
g0nNVh2ujlRTSIiRAeEKpFhEG5BUvsr+EDaYN5HxECz/I9hYPAwp8hOqYfRctH5qT/1rYIX59wku 
VRQDHVPzAMbv4kcSC/d/76RrKED24mpGOTteHWb4gyV5wkMY3lauJ2Kt525x+66BeXwGFubP+Ty4 
bTvQZAlcRrNw7vkhaGIx6DWxyYWED5EFPWI3/GZ0xzTbpL83DUVUtS/ediGlJTj5NyBlLtEcuRLv 
XE5a6kiJU6ZLCcSmSDdBluUKyuUqqIwddbhBpeNik8bzS3aT6kOxhwlOIQZeunaIaLdBDlUGcQ6i 
1Op7pe9lurj06xerCWDRwcQjFjpj3ZVCR1z9NuCRkV+YCYWS 

在这里与过时的编码器7.0编码PHP代码(PHP 5.6及以下):

<?php //0046b 
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); 

?> 
HR+cPztBoaaSBCzkpN9VQlx61diBTKY3K9Mo6QkiHctnYMVjt+wt5LKPQiXrdL2L4kPfUYzmMESC 
lcAxEsG3poSelwD+kdd08ZYEwxLBpp7ygESUJ3bafOEpLpdkuPTvrz8X69Zu7qlvz818LBJQe/Tz 
mxcC8cJvxWBWfyVldqFIfwAdP7FElroV7giVwaoFWplm+3Ut5FutMAWRd7f95Gb9ghPgLSMS7crq 
4Qx1E3bK1BTXgDrKZ0RfRbd2gSLZlA97dGwTbM8ccs9bbie3LGVEtZlGR/J9Bz142go08cr/Taym 
xfs4+ITF7iqEk8gWdywHV1tYKJvc26w4bpIW51IcXdcd0QDIdhx4PfTVmMxyVVmqPuVv8L23N6EI 
sTAuCNc5o8LjRzW2Yp4ctMJVPKkjWmg4HKs95xZABDbJ