1. 程式人生 > >CI 安裝 composer

CI 安裝 composer

reat 目錄 進入 tab 創建 roc read 如果 directory

環境 ubuntu 16.04

  1. 在項目根目錄手動創建 composer.json 文件,引入包:
{
    "require": {
        "phpoffice/phpspreadsheet": "^1.3"
    }
}
  1. 終端進入項目根目錄,輸入命令: composer require phpoffice/phpspreadsheet

技術分享圖片

  1. 在項目根目錄會出現 vendor 文件夾

如果出現目錄沒有寫入權限,需要授權下

Cannot create cache directory /home/xiaoke/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/xiaoke/.composer/cache/files/, or directory is not writable. Proceeding without cache

進入 .composer 文件夾

sudo chmod -R 777 cache/

CI 安裝 composer