最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
解决thinkphp php7 Cannot use ‘String’ as class name as it is reserved
时间:2022-06-25 02:26:45 编辑:袖梨 来源:一聚教程网
我有一网站之前用php7运行thinkphp没有什么问题,但是最近发现开启验证码的时候发现有错误
Cannot use 'String' as class name as it is reserved
在google baidu搜索了一下还是没有解决方法
于是自己动手解决,看来我是第一个分享出来的人
原因:
有一个类用了string类名,php7把String定为关键字
解决方法:
文件ThinkPHPLibraryOrgUtilImage.class.php
找到
import('ORG.Util.String');
$code = String::rand_string($length, 4);
修改成
import('ORG.Util.Stringnew');
$code = Stringnew::rand_string($length, 4);
复制文件
ThinkPHPLibraryOrgUtilString.class.php
保存成
ThinkPHPLibraryOrgUtilStringnew.class.php
打开Stringnew.class.php
class String {
修改成
class Stringnew {
放上去验证码出来了,我搜索了一下没有其他地方引用,这个问题解决了
原文链接地址:
相关文章
- 新三国志曹操传马超无双试炼四通关攻略 12-15
- 俄罗斯YANDEX引擎官网入口-免登录直达Yandex首页 12-15
- 漫蛙ManWa在线免费阅读入口_漫蛙ManWa官方网页版一键直达 12-15
- 逃离鸭科夫仓库区地窖在哪 仓库区地窖入口位置详情 12-15
- 光与影33号远征队熙艾尔bd玩法:熙艾尔毕业装备与加点思路介绍 12-15
- 漫蛙网页版免费入口进不去-漫蛙网页版最新免费版一键直达 12-15