【发布时间】:2016-02-04 00:55:17
【问题描述】:
我正在使用 PHTML 编码器对我的 php 文件进行编码,但是当我运行编码文件时它给出错误“调用未定义的函数 dl()”。 请有人帮忙。
<?php
if(!function_exists("phtmldec")){
$w=(substr(PHP_OS,0,3)=="WIN")?1:0;$ln="phtmlenc".phpversion();$cd=dirname(__FILE__);
if($w){
$ln=$ln.".dll";if($cd[1]==":") $cd=substr($cd,2);
} else {
$ln=$ln.".so";if(strlen($cd)<3) $cd=getcwd();
}
if(version_compare(phpversion(),"5.2.5")==-1){
$cd1=ini_get('extension_dir');
$cd2=PHP_EXTENSION_DIR;
if($cd[strlen($cd)-1]!="/")$cd=$cd."/";
if($cd1[strlen($cd1)-1]!="/")$cd1=$cd1."/";
if($cd2[strlen($cd2)-1]!="/")$cd2=$cd2."/";
if($cd1[1]==":") $cd1=substr($cd1,2);
if($cd2[1]==":") $cd2=substr($cd2,2);
$ic=substr_count($cd,"\\")+substr_count($cd,"/");
$ic1=substr_count($cd1,"\\")+substr_count($cd1,"/");
$ic2=substr_count($cd2,"\\")+substr_count($cd2,"/");
$en=str_repeat("../",max($ic,$ic1,$ic2))."..".$cd.$ln;
} else {
$en=$ln;$r=dl($en);if(!$r)exit("Unable to load $en");
}
$p="F4\$A016YC2@Y(8Q[Y!2F3[@K2.0>K0Z%5^#2\\,&;5L7\$<KHL)BH<`";
phtmldec($p);
}
?>
【问题讨论】:
-
dl自 5.3 起默认禁用 -
我刚刚整理了您的代码,并且您在代码末尾缺少一个起始大括号 {(就在最后一个 else 之后)和一个封闭的大括号 }。
-
@aleation 但是仍然出现同样的错误。
-
@k102 那么我如何将 PHTML 编码器用于版本高于 5.3 的 php
标签: php