#1 chaoyinshu
在配置密码扩展时出现Fatal error: Call to undefined function import() in
/var/www/index.phpon line
46怎么解决:handshake
2010-08-30 11:22:59
#2 jake
index.php中需要在载入speedphp框架后才能开始使用import函数,也就是在
require(SP_PATH.'/SpeedPHP.php');
// 从这里开始才能使用import
import(xxx);
spRun();
如果在require(SP_PATH.'/SpeedPHP.php');之前只能用include或者require
2010-08-30 11:41:37
#3 chaoyinshu
我在index里载入了import('md5password.php');
2010-08-30 11:49:23
#4 jake
Call to undefined function import() 这个错误提示指的是import没有定义,所以应该要载入speedphp.php文件。require(SP_PATH.'/SpeedPHP.php');
2010-08-30 12:23:58
#5 chaoyinshu
define("SP_PATH",dirname(__FILE__)."/hczphp");
define("APP_PATH",dirname(__FILE__));
require("webconfig.php");
$spConfig = array(
"db" => array( // 数据库设置
'host' => 'localhost',
'login' => 'root',
'password' => 'tttttt',
'database' => 'cccccccc',
'prefix' => 'pubgb_',
),
'view' => array(
'enabled' => TRUE, // 开启视图
'config' =>array(
'template_dir' => APP_PATH.'/hczmb', // 模板目录
'compile_dir' => APP_PATH.'/tmp', // 编译目录
'cache_dir' => APP_PATH.'/tmp', // 缓存目录
'left_delimiter' => '<{', // smarty左限定符
'right_delimiter' => '}>', // smarty右限定符
),
'html' => array( // HTML生成配置
'enabled' => TRUE, // 开启HTML生成功能
),
'auto_display' => TRUE, // 使用自动输出模板功能
'auto_display_sep' => "_", // 自动输出模板的拼装模式,/为按目录方式拼装,_为按下划线方式,这里用下划线
),
'launch' => array(
'router_prefilter' => array(
array('spAcl','mincheck') // 开启有限的权限控制
// array('spAcl','maxcheck') // 开启强制的权限控制
)
),
'ext' => array( // 扩展设置
'spAcl' => array( // acl扩展设置
// 在acl中,设置无权限执行将lib_user类的acljump函数
'prompt' => array("lib_user", "acljump"),
),
)
);
require(SP_PATH."/SpeedPHP.php");
import('md5password.php');
spRun();还是有问题?
是不是必须用默认路径
2010-08-30 14:43:18
#6 chaoyinshu
问题已解决,保存路径出现错误更正后以正常 郁闷:L
2010-08-30 15:28:37
#7 jake
出错提示还是Call to undefined function import() ?
2010-08-30 15:29:51