首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >致命错误:未捕获错误:在php7的cakephp-2.2.0项目中找不到类“String”

致命错误:未捕获错误:在php7的cakephp-2.2.0项目中找不到类“String”
EN

Stack Overflow用户
提问于 2018-04-22 00:18:29
回答 1查看 1.1K关注 0票数 0

致命错误:未捕获错误:在php7的cakephp-2.2.0项目中找不到类“String”

项目是用php-5编写的,现在系统有了php-7.

完全错误:

代码语言:javascript
复制
Fatal error: Uncaught Error: Class 'String' not found in /var/www/html/allblog/lib/Cake/Model/Datasource/DboSource.php:2298 Stack trace: #0 /var/www/html/allblog/lib/Cake/Model/Datasource/DboSource.php(1050): DboSource->fields(Object(Post), 'Post', 'COUNT(*) AS `co...') #1 /var/www/html/allblog/lib/Cake/Model/Model.php(2631): DboSource->read(Object(Post), Array) #2 /var/www/html/allblog/lib/Cake/Controller/Component/PaginatorComponent.php(185): Model->find('count', Array) #3 /var/www/html/allblog/lib/Cake/Controller/Controller.php(1082): PaginatorComponent->paginate(Object(Post), Array, Array) #4 /var/www/html/allblog/app/Controller/AppController.php(66): Controller->paginate('Post') #5 /var/www/html/allblog/lib/Cake/Controller/CakeErrorController.php(74): AppController->beforeRender() #6 /var/www/html/allblog/lib/Cake/Event/CakeEventManager.php(246): CakeErrorController->beforeRender(Object(CakeEvent)) #7 /var/www/html/allblog/lib/Cake/Controller/Controller.php(922): CakeEventManager->dispatch(Object(CakeEvent)) #8 /var/ in /var/www/html/allblog/lib/Cake/Model/Datasource/DboSource.php on line 2298

我该如何解决这个问题?

EN

回答 1

Stack Overflow用户

发布于 2018-04-22 09:01:01

使用CakeText代替。

建议使用,因为它提供了与PHP7和HHVM兼容的功能。

请参阅:https://book.cakephp.org/2.0/en/core-utility-libraries/string.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49961343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档