繁体   English   中英

检查IonCube Loader是否已安装的最佳方法

[英]Best method for checking if IonCube Loader is installed

我正在使用以下代码:

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

我只是担心这对于启用了IonCube的每台服务器都不起作用。 它似乎很标准,但我以前从未需要检查。 这是检查的最佳方式,还是我应该使用更好的方法?

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

另一种选择是使用get_loaded_extensions() 这将返回一个包含可用扩展名的数组。 您可以检查此数组是否包含所需的扩展名。

另一种方法是

<?php
phpinfo()
?>

并在“附加模块”标题下查看,您应该能够看到

ionCube Loader

实际上我使用SSH来处理大部分事情,包括文件复制。 当我需要检查ionCube加载器时,对我来说更简单的方法就是php -m

由于字母顺序,Zend模块列在底部。

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

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

这里用最新的编码器v9.0(PHP 5.6 / 7.0)加密的PHP代码,如果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=

这里用遗留编码器8.3(PHP 5.6及以下版本)编码的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+cPp7q/tHOKq74dpvDQdk0enKwrkMD5yeF5eIiq+jd6h+ygyi99Yw9v+skX6plOCkD0S6vxDVT
g0nNVh2ujlRTSIiRAeEKpFhEG5BUvsr+EDaYN5HxECz/I9hYPAwp8hOqYfRctH5qT/1rYIX59wku
VRQDHVPzAMbv4kcSC/d/76RrKED24mpGOTteHWb4gyV5wkMY3lauJ2Kt525x+66BeXwGFubP+Ty4
bTvQZAlcRrNw7vkhaGIx6DWxyYWED5EFPWI3/GZ0xzTbpL83DUVUtS/ediGlJTj5NyBlLtEcuRLv
XE5a6kiJU6ZLCcSmSDdBluUKyuUqqIwddbhBpeNik8bzS3aT6kOxhwlOIQZeunaIaLdBDlUGcQ6i
1Op7pe9lurj06xerCWDRwcQjFjpj3ZVCR1z9NuCRkV+YCYWS

这里用过时的编码器7.0(PHP 5.6及以下版本)编码的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+cPztBoaaSBCzkpN9VQlx61diBTKY3K9Mo6QkiHctnYMVjt+wt5LKPQiXrdL2L4kPfUYzmMESC
lcAxEsG3poSelwD+kdd08ZYEwxLBpp7ygESUJ3bafOEpLpdkuPTvrz8X69Zu7qlvz818LBJQe/Tz
mxcC8cJvxWBWfyVldqFIfwAdP7FElroV7giVwaoFWplm+3Ut5FutMAWRd7f95Gb9ghPgLSMS7crq
4Qx1E3bK1BTXgDrKZ0RfRbd2gSLZlA97dGwTbM8ccs9bbie3LGVEtZlGR/J9Bz142go08cr/Taym
xfs4+ITF7iqEk8gWdywHV1tYKJvc26w4bpIW51IcXdcd0QDIdhx4PfTVmMxyVVmqPuVv8L23N6EI
sTAuCNc5o8LjRzW2Yp4ctMJVPKkjWmg4HKs95xZABDbJ

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM