tp框架部署在新浪sae上报错,无法加载C()函数

heshan100 2016-10-23 09:46:08
最近用tp3.2.3做了一个web网站部署在新浪sae上,用的环境是php7.0。然后上传代码包之后,输入域名发现sae日志中心报错无法加载C()函数,这是TP框架自带的系统函数,怎么会这样?具体报错代码如下:
182.100.57.5 [23-Oct-2016:09:33:33 +0800] PHP Fatal error: Uncaught Error: Call to undefined function Think\C() in /data1/www/htdocs/553/fiachra/1/pnp/ThinkPHP/Library/Think/Think.class.php:304#012Stack trace:#012#0 /data1/www/htdocs/553/fiachra/1/pnp/ThinkPHP/Library/Think/Think.class.php(273): Think\Think::halt(Array)#012#1 [internal function]: Think\Think::fatalError()#012#2 {main}#012 thrown in /data1/www/htdocs/553/fiachra/1/pnp/ThinkPHP/Library/Think/Think.class.php on line 304 bx188
然后我找到报错代码发现是halt($error)函数,于是我dump($error),发现错误是来自于:TP框架中Log.class.php中的C()无法加载,为call undefined Think/C()
static function record($message,$level=self::ERR,$record=false) {
if($record || false !== strpos(C('LOG_LEVEL'),$level)) {
self::$log[] = "{$level}: {$message}\r\n";
}
}

1.部署时index.php中已经关闭了app_debug。
2.删除了runtime中的所有缓存文件。
以上步骤都没有用,于是我下载一个新的TP框架放入服务器中,发现也是报同样的错误。
...全文
1141 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
King逍灬遥 2019-01-30
  • 打赏
  • 举报
回复
1146:Table 'app_liu0118.sp_plugins' doesn't exist [ SQL语句 ] : SHOW COLUMNS FROM `sp_plugins` 错误位置 FILE: /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Db/Driver.class.php  LINE: 350 TRACE #0 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Db/Driver.class.php(350): E('1146:Table 'app...') #1 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Db/Driver.class.php(180): Think\Db\Driver->error() #2 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Db/Driver/Mysql.class.php(56): Think\Db\Driver->query('SHOW COLUMNS FR...') #3 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Model.class.php(134): Think\Db\Driver\Mysql->getFields('sp_plugins') #4 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Model.class.php(122): Think\Model->flush() #5 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Model.class.php(1454): Think\Model->_checkTableInfo() #6 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Model.class.php(97): Think\Model->db(0, '', true) #7 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Common/functions.php(645): Think\Model->__construct('Plugins', '', '') #8 /data1/www/htdocs/143/liu0118/1/application/Common/Behavior/InitHookBehavior.class.php(17): M('Plugins') #9 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Hook.class.php(153): Common\Behavior\InitHookBehavior->run(NULL) #10 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Hook.class.php(89): Think\Hook::exec('Common\\Behavior...', 'app_init', NULL) #11 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/App.class.php(194): Think\Hook::listen('app_init') #12 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/Library/Think/Think.class.php(120): Think\App::run() #13 /data1/www/htdocs/143/liu0118/1/thinkphp/Core/ThinkPHP.php(97): Think\Think::start() #14 /data1/www/htdocs/143/liu0118/1/index.php(56): require('/data1/www/htdo...') #15 {main}
horizon_zpy 2019-01-30
  • 打赏
  • 举报
回复
新浪SAE是不能写磁盘空间的,所以,不能用缓存,除非用新浪的api写内存缓存。
heshan100 2016-10-23
  • 打赏
  • 举报
回复
引用 5 楼 xuzuning 的回复:
TP for SAE 只比 TP 多一个类 当然在设置工作模式时,要选 SAE。 这在 TP 的开发手册中都说的很清楚了
我去看看,我第一次使用TP部署,所以有些不了解。之前都是在本地做。工作模式是什么?
xuzuning 2016-10-23
  • 打赏
  • 举报
回复
TP for SAE 只比 TP 多一个类 当然在设置工作模式时,要选 SAE。 这在 TP 的开发手册中都说的很清楚了
heshan100 2016-10-23
  • 打赏
  • 举报
回复
引用 3 楼 xuzuning 的回复:
SAE 的 php 什么时候升到 7 啦?请你核实一下 TP 需要写临时文件,这对 SAE 免费用户是做不到的 即便是收费用户(虚拟文件系统和内存缓存是收费的),也要使用 TP 的 for SAE 版本 SAE 提供了经他改造的 TP 供免费用户使用(当然略有差异)
我不是用的那个免费的,我是那个可以FTP上传文件的(免费的只能通过GIT SVN进行部署) 我昨天在创建应用的时候是可以选择PHP 5.3 5.6 7.0三个的。 那按照您的意思是,如果我想继续在这上面运行,需要下载TP for SAE...或者能推荐一个更好的服务器商吗?谢谢了!
xuzuning 2016-10-23
  • 打赏
  • 举报
回复
SAE 的 php 什么时候升到 7 啦?请你核实一下 TP 需要写临时文件,这对 SAE 免费用户是做不到的 即便是收费用户(虚拟文件系统和内存缓存是收费的),也要使用 TP 的 for SAE 版本 SAE 提供了经他改造的 TP 供免费用户使用(当然略有差异)
heshan100 2016-10-23
  • 打赏
  • 举报
回复
大哥们大神们有碰到类似问题的吧
heshan100 2016-10-23
  • 打赏
  • 举报
回复
引用 7 楼 heshan100 的回复:
[quote=引用 5 楼 xuzuning 的回复:] TP for SAE 只比 TP 多一个类 当然在设置工作模式时,要选 SAE。 这在 TP 的开发手册中都说的很清楚了
你好,经过我一番折腾,现在报这个错了: _STORAGE_WRITE_ERROR_:./Application/Runtime/Cache/Web/ae3e3553a8e8c19d78c414023b504955.php 错误位置 FILE: /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Storage/Driver/Sae.class.php  LINE: 90 TRACE #0 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Storage/Driver/Sae.class.php(90): E('_STORAGE_WRITE_...') #1 [internal function]: Think\Storage\Driver\Sae->put('./Application/R...', '1477229709 #2 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Storage.class.php(37): call_user_func_array(Array, Array) #3 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Template.class.php(114): Think\Storage::__callstatic('put', Array) #4 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Template.class.php(76): Think\Template->loadTemplate('./Application/W...', '') #5 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Behavior/ParseTemplateBehavior.class.php(32): Think\Template->fetch('./Application/W...', Array, '') 是不是跟缓存有关?是不是要初始化memcache[/quote] 数据库和缓存都初始化了,还有stroage也是,还是报同样的错
heshan100 2016-10-23
  • 打赏
  • 举报
回复
关于TP中Log的报错如下: 182.100.57.5 [23-Oct-2016:09:33:33 +0800] PHP Fatal error: Uncaught Error: Call to undefined function Think\C() in /data1/www/htdocs/553/fiachra/1/pnp/ThinkPHP/Library/Think/Log.class.php:52#012Stack trace:#012#0 /data1/www/htdocs/553/fiachra/1/pnp/ThinkPHP/Library/Think/Think.class.php(227): Think\Log::record('Call to undefin...', 'ERR')#012#1 [internal function]: Think\Think::appException(Object(Error))#012#2 {main}#012 thrown in /data1/www/htdocs/553/fiachra/1/pnp/ThinkPHP/Library/Think/Log.class.php on line 52 bx188
heshan100 2016-10-23
  • 打赏
  • 举报
回复
引用 5 楼 xuzuning 的回复:
TP for SAE 只比 TP 多一个类 当然在设置工作模式时,要选 SAE。 这在 TP 的开发手册中都说的很清楚了
你好,经过我一番折腾,现在报这个错了: _STORAGE_WRITE_ERROR_:./Application/Runtime/Cache/Web/ae3e3553a8e8c19d78c414023b504955.php 错误位置 FILE: /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Storage/Driver/Sae.class.php  LINE: 90 TRACE #0 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Storage/Driver/Sae.class.php(90): E('_STORAGE_WRITE_...') #1 [internal function]: Think\Storage\Driver\Sae->put('./Application/R...', '1477229709 #2 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Storage.class.php(37): call_user_func_array(Array, Array) #3 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Template.class.php(114): Think\Storage::__callstatic('put', Array) #4 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Think/Template.class.php(76): Think\Template->loadTemplate('./Application/W...', '') #5 /data1/www/htdocs/553/fiachra/1/page/ThinkPHP/Library/Behavior/ParseTemplateBehavior.class.php(32): Think\Template->fetch('./Application/W...', Array, '') 是不是跟缓存有关?是不是要初始化memcache

4,250

社区成员

发帖
与我相关
我的任务
社区描述
国内外优秀PHP框架讨论学习
社区管理员
  • Framework
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧