【发布时间】:2019-07-09 14:30:45
【问题描述】:
当我运行全新安装 laravel 5.8 时出现错误
Laravel 5.7 版安装没有问题。有人知道怎么解决吗?
生成优化的自动加载文件
> 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
堆栈跟踪:
#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
更新我的 .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}"
【问题讨论】:
-
删除
bootstrap/cache/config.php并先运行php artisan clear:config。 -
bootstrap/cache/config.php - 没有这样的文件。 php artisan clear:config - 出现错误 PHP 致命错误:未捕获的 ReflectionException:类配置不存在于 ....
-
您可以发布您的
.env文件的内容吗? -
添加到主帖
-
你试过
php artisan clear和php artisan config:clear