调用未定义的函数dl() [英] Call to undefined function dl()
本文介绍了调用未定义的函数dl()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用PHTML编码器来编码我的php文件,但是当我运行编码文件时,它给出了错误消息调用未定义的函数dl()". 有人请帮忙.
I am using PHTML encoder to encode my php file but it is giving error "Call to undefined function dl()" when i run the encoded file. Somebody please help.
<?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);
}
?>
推荐答案
@ k102提到的dl()
从5.3开始默认被禁用:
as @k102 mentioned dl()
has been disabled by default since 5.3:
如php文档中所述: http://php.net/manual/en/function.dl.php
as refered on the php documentation: http://php.net/manual/en/function.dl.php
5.3.0 dl() is now disabled in some SAPIs due to stability issues.
The only SAPIs that allow dl() are CLI and Embed. Use the Extension Loading Directives instead.
根据此处的建议,改用扩展加载指令: http://www.php.net/manual/en/ini .core.php#ini.extension
as suggested there, use the Extension Loading Directives instead: http://www.php.net/manual/en/ini.core.php#ini.extension
基本上,您唯一的选择是:
Basically your only choices are:
- 在php.ini上加载正确配置的扩展名
- 使用文档中提到的仍支持
dl()
的上述SAPI之一: (CLI,CGI和嵌入) - 如果确实需要动态加载php版本,请降级
- Load the extension configuring it properly on the php.ini
- Use one of the mentioned SAPI's that still supports
dl()
as mentioned in the documentation: (CLI, CGI and Embed) - Downgrade your php version if you really need to load it dinamically
这篇关于调用未定义的函数dl()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文