执行某个控制器的方法时(http://test.com:9501/?s=index/index/test)其中这个方法必须是return 如果是echo 必须加 exit 否则会报错
2.修改thinkphp源码
thinkphp\library\think\Request.php
修改public function pathinfo()方法
注释
if (is_null($this->pathinfo)) {判断条件注释掉
修改public function path()方法
注释
if (is_null($this->path)) {判断条件注释掉
修改(解决获取不到请求参数的问题报错method not exists:think\Request->filterValue)
private function filterValue(&$value, $key, $filters)
改为
public function filterValue(&$value, $key, $filters)
需要注意的是,tp5.1.38这个版本在
$http->on('request', function ($request, $response) {}
中不需要重写server和header