ThinkPHP5.0.24运行于php8.2(分销主机)

@Ta 2023-12-22发布,2023-12-23修改 154点击

thinkphp_5.0.24_with_extend.zip(2.35 MB)

01.jpg(81.54 KB)

  • 增加一行判断:if($name==NULL){$name='';}

02.jpg(66.91 KB)

  • 第二个错误 getClass() 改为:getType()

03.jpg(93.67 KB)

  • 第三个错误,很明显,{}改为[]

04.jpg(140.53 KB)

  • 随后是一堆错误,基本都是数据类型问题

  • \thinkphp\library\think\Paginator.php

增加:use Iterator;
offsetExists($offset)改为 offsetExists($offset):bool
offsetSet($offset, $value)改为 offsetSet($offset, $value):void
offsetGet($offset) 改为 offsetGet($offset):mixed
offsetUnset($offset)改为 offsetUnset($offset):void
getIterator()改为 getIterator(): Iterator|Traversable
count()改为 count():int
jsonSerialize()改为jsonSerialize(): mixed
  • \thinkphp\library\think\Collection.php
offsetExists($offset)改为 offsetExists($offset):bool
offsetSet($offset, $value)改为 offsetSet($offset, $value):void
offsetGet($offset) 改为 offsetGet($offset):mixed
offsetUnset($offset)改为 offsetUnset($offset):void
getIterator()改为 getIterator():IteratorAggregate
count()改为 count():int
jsonSerialize()改为jsonSerialize(): mixed

1_93WRYWFF4BGGZ6J.jpg(77.79 KB)

  • 去掉第二参数null即可

至此,正常运行

  • 下面附上apache伪静态
<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
</IfModule>
回复列表(4|显示机器人聊天)
添加新回复
回复需要登录