运行Composer安装时如何解决错误?

时间:2019-05-31 20:50:37

标签: php laravel

运行composer install时我被卡住了。

akbar-pc@akbarpc:/var/www/html/project$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
Nothing to install or update
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postInstall
> php artisan optimize
PHP Fatal error:  Uncaught Dotenv\Exception\InvalidPathException: Unable to read the environment file at /data/server-configuration/.env. in /var/www/html/project/vendor/vlucas/phpdotenv/src/Loader.php:106
Stack trace:
#0 /var/www/html/project/vendor/vlucas/phpdotenv/src/Loader.php(83): Dotenv\Loader->ensureFileIsReadable()
#1 /var/www/html/project/vendor/vlucas/phpdotenv/src/Dotenv.php(114): Dotenv\Loader->load()
#2 /var/www/html/project/vendor/vlucas/phpdotenv/src/Dotenv.php(81): Dotenv\Dotenv->loadData(true)
#3 /var/www/html/project/bootstrap/app.php(19): Dotenv\Dotenv->overload()
#4 /var/www/html/project/artisan(18): require_once('/var/www/html/p...')
#5 {main}
  thrown in /var/www/html/project/vendor/vlucas/phpdotenv/src/Loader.php on line 106
Script php artisan optimize handling the post-install-cmd event returned with an error


  [RuntimeException]                                                                                                    
  Error Output: PHP Fatal error:  Uncaught Dotenv\Exception\InvalidPathException: Unable to read the environment file   
  at /data/server-configuration/.env. in /var/www/html/project/vendor/vlucas/phpdotenv/src/Loader.php:106                
  Stack trace:                                                                                                          
  #0 /var/www/html/project/vendor/vlucas/phpdotenv/src/Loader.php(83): Dotenv\Loader->ensureFileIsReadable()             
  #1 /var/www/html/project/vendor/vlucas/phpdotenv/src/Dotenv.php(114): Dotenv\Loader->load()                            
  #2 /var/www/html/project/vendor/vlucas/phpdotenv/src/Dotenv.php(81): Dotenv\Dotenv->loadData(true)                     
  #3 /var/www/html/project/bootstrap/app.php(19): Dotenv\Dotenv->overload()                                              
  #4 /var/www/html/project/artisan(18): require_once('/var/www/html/p...')                                               
  #5 {main}                                                                                                             
    thrown in /var/www/html/project/vendor/vlucas/phpdotenv/src/Loader.php on line 106                                   


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

1 个答案:

答案 0 :(得分:0)

尝试composer install -vvv输出调试日志以分析错误