简体   繁体   English

laravel 5.8。*安装失败

[英]laravel 5.8.* installation failed

When I run a clean install laravel 5.8 get an error 当我运行一个干净的安装laravel 5.8得到一个错误

Laravel version 5.7 is installed without problems. Laravel 5.7版安装没有问题。 Does anyone know how to fix it? 有谁知道如何修理它?

Generating optimized autoload files 生成优化的自动加载文件

> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
PHP Fatal error:  Uncaught ReflectionException: Class config does not exist in /home/projects/test/vendor/laravel/framework/src/Illuminate/Container/Container.php:790

Stack trace: 堆栈跟踪:

#0 /home/projects/test/vendor/laravel/framework/src/Illuminate/Container/Container.php(790): ReflectionClass->__construct('config')
#1 /home/projects/test/vendor/laravel/framework/src/Illuminate/Container/Container.php(667): Illuminate\Container\Container->build('config')
#2 /home/projects/test/vendor/laravel/framework/src/Illuminate/Container/Container.php(615): Illuminate\Container\Container->resolve('config', Array)
#3 /home/projects/test/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(767): Illuminate\Container\Container->make('config', Array)
#4 /home/projects/test/vendor/laravel/framework/src/Illuminate/Container/Container.php(1225): Illuminate\Foundation\Application->make('config')
#5 /home/projects/test/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(417): Illuminate\Container\Container->offsetGet('config')
#6 /h in /home/projects/test/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 790

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

Updated my .env file This file is created during installation 更新了我的.env文件此文件是在安装期间创建的

APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=false
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

I do not see APP_KEY in your .env file. 我的.env文件中没有看到APP_KEY

At the command line, issue the following Artisan command to generate a key: 在命令行中,发出以下Artisan命令以生成密钥:

php artisan key: generate

This will generate a random key for APP_KEY , After completion of .env edit please enter this command in your terminal for clear cache: php artisan config:cache 这将生成APP_KEY的随机密钥,完成.env编辑后,请在终端中输入此命令以进行清除缓存: php artisan config:cache


If you faced a problem because the vendor folder then follows these steps: 如果您遇到问题,因为供应商文件夹然后遵循以下步骤:

composer update --no-scripts 
composer update
  • --no-scripts : Skips execution of scripts defined in composer.json --no-scripts :跳过composer.json定义的脚本的执行
  • composer update : This will check for newer versions of the libraries you required in your project. composer update :这将检查项目中所需库的更新版本。 If a newer version is found and it's compatible with the version constraint defined in the composer.json file, it will replace the previous version installed. 如果找到更新的版本并且它与composer.json文件中定义的版本约束兼容,它将替换以前安装的版本。 The composer.lock file will be updated to reflect these changes. composer.lock文件将更新以反映这些更改。

These two commands, we will Recreate the vendor folder in our project 这两个命令,我们将在我们的项目中重新创建vendor文件夹

You need to reinstall laravel . 你需要重新安装laravel Please delete your vendor directory or rename it and then run composer install . 请删除您的vendor目录或重命名,然后运行composer install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试安装 Laravel 6,但命令返回 5.8.* - Trying to install laravel 6, but command return 5.8.* Laravel 5.8.* 在生产中使用 GuzzleHttp - Laravel 5.8.* using GuzzleHttp on production Laravel 5.8.* Eloquent 查询(使用 LeftJoin)返回不正确的关系结果 - Laravel 5.8.* Eloquent Query (with LeftJoin) Returning Incorrect Relation Results Laravel 5.8.* 来自本地服务器的身份验证邮件错误:swift_transportexception (554) - Laravel 5.8.* Auth mail error from local server: swift_transportexception (554) 我正在使用PHP Laravel 5.8创建编辑页面。 我已经创建了路由和网址,但未显示错误404 - I am creating edit page using PHP Laravel 5.8. I have created routes and url, but error 404 not found shows up 安装 package 时出现错误 laravel 5.8(安装失败,正在恢复。/composer.json 到其原始内容。) - Error laravel 5.8 installing package (Installation failed, reverting ./composer.json to its original content.) Laravel 5.8中的laravelcollective / html软件包安装问题 - laravelcollective/html package installation issue in Laravel 5.8 laravel 8 安装失败 - laravel 8 installation failed 如何用流明5.8中的dingo修复实现jwt。*? 目标[Dingo \\ Api \\ Contract \\ Routing \\ Adapter]不可实例化 - How to fix implementation jwt with dingo in lumen 5.8.*? Target [Dingo\Api\Contract\Routing\Adapter] is not instantiable laravel5.8请求失败,状态码为500 - laravel5.8 Request failed with status code 500
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM