thinkphp升級後報錯Declaration of thinkappUrl::build() must be compatible with think outeUrl::build():

邓草發表於2024-11-15

將原始碼中的thinkphp升級後,發現了錯誤:Declaration of think\app\Url::build() must be compatible with think\route\Url::build(): string

出現這個錯誤的原因是,你透過命令“composer update topthink/framework”只升級了框架,沒有更新多應用擴充套件模組。

只需要composer執行下面程式碼更新多應用擴充套件模組到最新版後即可解決:

composer update topthink/think-multi-app
thinkphp升級後報錯Declaration of thinkappUrl::build() must be compatible with think
outeUrl::build():

更新完成後,專案執行正常。

相關文章