1. 程式人生 > >laravel composer 依賴安裝報錯現象分析

laravel composer 依賴安裝報錯現象分析

load packagist pla 依賴 erro dep https 總結 tis

Q&A1:安裝composer依賴時報錯:
總結:安裝composer 依賴包時出現這個問題,原因在於配置文件中連接的數據庫中沒有將當前應用服務器加入到白名單中導致的;
事實上數據庫配置改為內網時就不存在了;而且此時的依賴包也是安裝成功的,而且已經進入到框架層進行檢測了。
>> composer install

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize

In Connection.php line 664:

  SQLSTATE[28000] [1045] ip not in whitelist or in blacklist, client ip is xx  
  .93.198.5 (SQL: select * from `permissions` where `permissions`.`deleted` =  
   0)                                                                          

In Connector.php line 67:

  SQLSTATE[28000] [1045] ip not in whitelist or in blacklist, client ip is xx  
  .93.198.5                                                                

Q&A2: 缺乏composer.lock文件

在laravel框架中存在兩個配置文件,composer.json, composer.lock,前者是
控制vender三方庫的來源,後者是控制調用的三方庫的來源。
Loading composer repositories with package information
Updating dependencies (including require-dev)

  [Seld\JsonLint\ParsingException]                                                                    
  "https://composer.DOMAIN_NAME.com/repo/packagist/p/barryvdh/laravel-cors.json" does not contain valid  
   JSON                                                                                               
  Parse error on line 1:                                                                              

  ^                                                                                                   
  Expected one of: ‘STRING‘, ‘NUMBER‘, ‘NULL‘, ‘TRUE‘, ‘FALSE‘, ‘{‘, ‘[‘                              

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

laravel composer 依賴安裝報錯現象分析