2010-08-13 84 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