系统重装了,Composer又要重新安装,现在对安装Composer级使用做个笔记,(适合新手)
系统:win10 64位,
直奔主题,打开Composer中文网(https://www.phpcomposer.com/),点击导航条,“下载”

跳到下载页(最新版本1.8.4),点击“Composer-Setup.exe ”安装包,下载

打开composer安装包后,勾选“Developer mode”(这操作可选),再选择“next”,

选择composer安装的路径,我这选择安装到D盘,再点“next”

到这部选择php.exe安装路径,(我是用phpstuday2018版),再点“Next”

到这步直接点“Next”,其他不要勾选(使用代理很慢),

到这就安装成功了。点“Finish”

测试composer是否有安装,打开cmd,输入composer,出现如图,即表示成功安装,最新版本V 1.8.4

要下载thinkPHP前,先更改镜像下,不然下载会很慢,
打开中国镜像 https://pkg.phpcomposer.com/#how-to-use-packagist-mirror
使用 方法一: 修改 composer 的全局配置文件

打开cmd输入以上命令,再按回车,没反应,就表示修改成功。
现在用刚安装好的composer安装最新版本的thinkPHP,
再次打开打开Composer中文网(https://www.phpcomposer.com/),点击“安装包列表”,

在打开的页面中输入think,现在第一个“topthink/think”就是,就是thinkPHP,点击

之后打开的页面中,显示“composer create-project topthink/think” 是thinkPHP的composer安装命令,最新版本是5.1.35

下载thinkPHP最新版本也是5.1.35,

如果下载前,没更改路径,那么下载好的thinkPHP在我的文档里。

网友评论