thinkphp6.0安装及composer一系列问题解决

安装

稳定版安装:

composer -vvv create-project topthink/think tp
开发版安装:

composer -vvv create-project topthink/think=6.0.x-dev tp

如果需要更新框架使用

composer update topthink/framework

Composer Downloader TransportException 解决方法

[root@localhost]# composer require "artisaninweb/laravel-soap" [Composer\Downloader\TransportException] Your configuration does not allow connection to http://packagist.phpcomposer.com. See https://getcomposer.org/doc/06-config.md#secure-http for details.

解决方法

1. 把默认的 secure-http 改成false

composer config -g secure-http false

2. 修改配置文件

#修改全局文件(推荐)
composer config -g repo.packagist composer https://packagist.phpcomposer.com

#修改当前配置文件
composer config repo.packagist composer https://packagist.phpcomposer.com

再不行就用
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

修改后

composer.json 文件

{
    "repositories": {
        "packagist": {
            "type": "composer",
            "url": "https://packagist.phpcomposer.com"
        }
    }
}

composer错误提示Cloning failed using an ssh key for authentication的解决方法

首先到https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+服务器名称+2018-07-08+0803这个地址重新生成一下token,点击regenerate,复制生成的token

thinkphp6.0安装及composer一系列问题解决_第1张图片

  然后放到auth.json文件里(文件须有写入的权限)

    "github-oauth": {
        "github.com": "这里填token"},

  保存就可以了。

  也可以用第二种方法:composer config --global --auth github-oauth.github.com token系列号

You can also add it manually later by using "composer config --global --auth github-oauth.github.com "

  看看auth.json文件是不是变了

  再看看composer安装是不是已经可以了

下载成功后就cd到网站目录,

php think run

你可能感兴趣的:(PHP)