• 使用composer遇到的问题及解决方法


      可以尝试利用composer下载Yii框架,编辑composer.json文件:

    {
        "require":{
            "yiisoft/yii2":"~2.0.0"
        }
    }
    

      然后在这个包含composer.json文件的目录下执行命令:

    composer install
    

      然后就等待下载完成

    问题零:Your requirements could not be resolved to an installable set of packages.

      如果出现下面这种情况:

    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    

      需要安装一个composer资源插件,运行命令安装即可:

    composer global require "fxp/composer-asset-plugin:^1.4.1"
    

      

    问题一:proc_get_status() has been disabled for security reasons 

      如果出现下面这种情况:

    [ErrorException]
    proc_get_status() has been disabled for security reasons
    PHP Fatal error: Uncaught exception 'ErrorException' with message 'proc_get_status() has been disabled for security reasons'
    in phar:///usr/local/bin/composer/vendor/symfony/process/Process.php:1279
    

      这是因为安全原因,将proc_get_status函数禁用了,可以通过编辑php的配置文件php.ini,搜索proc_get_status,将他从disable_functions中删除即可。

    问题二:需要输入token

      如果是第一次使用composer,那么在下载文件yii框架的过程中,有几项需要输入token,如下图:

    [root@localhost tmp]# composer install
    Loading composer repositories with package information
    Updating dependencies (including require-dev)
    
    Could not fetch https://api.github.com/repos/jquery/jquery-dist, please create a GitHub OAuth token to go over the API rate limit
    Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+localhost.localdomain+2018-02-22+1945
    to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
    Token (hidden):
    

      只要粘贴上面的URL到浏览器中打开,然后生成一个token,然后复制这个新的token,在命令行中需要token的地方输入该token即可,该token会存储在用户家目录/.composer/auth.json中:

    {
        "bitbucket-oauth": {},
        "github-oauth": {
            "github.com": "6ad4ef7375b1fb9........"},
        "gitlab-oauth": {},
        "gitlab-token": {},
        "http-basic": {}
    }
    

      此后可以不用再输入token了,composer会自动去auth.json中找。

  • 相关阅读:
    30 字符编码
    Xilinx Vivado的使用详细介绍(3):使用IP核
    Xilinx Vivado的使用详细介绍(1):创建工程、编写代码、行为仿真
    Vivado SDK ,调用math.h函数的时候出现 undefined reference to `xxx' ,解决方案
    Xilinx Vivado的使用详细介绍(4):Zedboard+vivado之流水灯(加SDK)
    xilinx Vivado的使用详细介绍(2):创建工程、添加文件、综合、实现、管脚约束、产生比特流文件、烧写程序、硬件验证
    no.4
    no.5
    关于贪心算法
    关于三角形把平面分成几块的问题
  • 原文地址:https://www.cnblogs.com/-beyond/p/8459958.html
Copyright © 2020-2023  润新知