下面是配置 如果我把APP_SUB_DOMAIN_DEPLOY去掉是可以启动Smart的。
Application/Common/Conf/config.php
return array(
//'配置项'=>'配置值'
'TMPL_ENGINE_TYPE'=>'Smarty',
'MODULE_ALLOW_LIST' => array(
'Pc',
'Wap',
),
'DEFAULT_MODULE' => 'Pc',
'APP_SUB_DOMAIN_DEPLOY' => 1, // 开启子域名或者IP配置
'APP_SUB_DOMAIN_RULES' => array(
'test.wap.ldustu.com'=>'Wap',
'test.ldustu.com'=>'Pc',
),
'URL_MODEL'=>1, //url模式 pathinfo
'URL_CASE_INSENSITIVE' => true, //URL不区分大小写
'SESSION_AUTO_START' => true,//是否开启session
'DB_TYPE' => 'mysql', // 数据库类型
'DB_HOST' => $_SERVER['LDSN_HOST'], // 服务器地址
'DB_NAME' => $_SERVER['LDSN_DBNAME'], // 数据库名
'DB_USER' => $_SERVER['LDSN_USER'], // 用户名
'DB_PWD' => $_SERVER['LDSN_PASSWD'], // 密码
'DB_PORT' => '3306', // 端口
'DB_PREFIX' => 'ldsn_', // 数据库表前缀
'DB_CHARSET' => 'utf8', // 数据库编码默认采用utf8
'TMPL_TEMPLATE_SUFFIX'=>'.tpl',
'TMPL_ENGINE_CONFIG'=>array(
'plugins_dir'=>'./Application/Tmpl/Plugins/',
'template_dir'=>'./Application/Tmpl/Template/',
'config_dir'=>'./Application/Tmpl/Config/',
'left_delimiter'=>'{%',
'right_delimiter'=>'%}'
),
);
下面是报错 test.wap.ldustu.com 明显还是自带的模板引擎
:(
模板不存在:./Application/Wap/View/Index/index.tpl
错误位置
FILE: /home/wwwroot/ldustu/server/ThinkPHP/Library/Think/View.class.php LINE: 110
TRACE
#0 /home/wwwroot/ldustu/server/ThinkPHP/Library/Think/View.class.php(110): E('???????????????...')
#1 /home/wwwroot/ldustu/server/ThinkPHP/Library/Think/View.class.php(72): Think\View->fetch('', '', '')
#2 /home/wwwroot/ldustu/server/ThinkPHP/Library/Think/Controller.class.php(56): Think\View->display('', '', '', '', '')
#3 /home/wwwroot/ldustu/server/Application/Wap/Controller/IndexController.class.php(13): Think\Controller->display()
#4 [internal function]: Wap\Controller\IndexController->index()
#5 /home/wwwroot/ldustu/server/ThinkPHP/Library/Think/App.class.php(164): ReflectionMethod->invoke(Object(Wap\Controller\IndexController))
#6 /home/wwwroot/ldustu/server/ThinkPHP/Library/Think/App.class.php(202): Think\App::exec()
#7 /home/wwwroot/ldustu/server/ThinkPHP/Library/Think/Think.class.php(120): Think\App::run()
#8 /home/wwwroot/ldustu/server/ThinkPHP/ThinkPHP.php(97): Think\Think::start()
#9 /home/wwwroot/ldustu/server/index.php(24): require('/home/wwwroot/l...')
#10 {main}
1
lmaq 2015-03-12 02:22:00 +08:00
模板不存在:./Application/Wap/View/Index/index.tpl
|
2
alex321 2015-03-12 08:27:06 +08:00
人家已经说了,模板不存在;再,注意 linux 下这货的大小写问题。
另,ThinkPHP 真是众多坑,虽说因为国产和文档问题被众多人夸赞,其实,其实,真的其实。 |