php -v
查看PHP版本,通过php -m
查看已安装扩展。composer show topthink/think
;php think version
;composer.json
文件中require
部分的topthink/think
版本号。composer require topthink/think:6.1.4
若需升级到最新稳定版,可直接运行:composer update topthink/think
升级过程中,Composer会自动处理依赖关系并更新框架文件。runtime
目录下的缓存),避免旧缓存影响新版本运行:rm -rf runtime/*
topthink/think-orm
),需同步升级至与新版本ThinkPHP兼容的版本,可通过composer update
命令完成。config
目录下的核心配置文件(如config.php
、database.php
、route.php
),重点关注以下变更:
think\Request::param()
方法参数变化);think\App
类的路径变化);topthink/think-orm
至对应版本);config/cache.php
中的驱动配置变更)。runtime
目录缓存;git pull
拉取最新代码;注意事项:
composer why-not topthink/think:目标版本
命令查看冲突原因,调整依赖版本解决;