小编NKo*_*Kol的帖子

Laravel - 尝试访问 int 类型值的数组偏移量

当我尝试向数据库提交发布请求时遇到问题。有趣的是,该错误仅在我使用 PHP 7.4.2 版时发生。在 PHP 7.3.9 版中一切正常。我正在使用 Laravel 6.17。

Laravel 什么时候会修复这个问题?

这是我的堆栈跟踪,当错误出现时。

Trying to access array offset on value of type int   
in CreateCourseController.php line 176
at HandleExceptions->handleError()
in CreateCourseController.php line 176
at CreateCourseController->createDates()
in CreateCourseController.php line 101
at CreateCourseController->createCourse()
at call_user_func_array()
in Controller.php line 54
at Controller->callAction()
in ControllerDispatcher.php line 45
at ControllerDispatcher->dispatch()
in Route.php line 219
at Route->runController()
in Route.php line 176
at Route->run()
in Router.php line 681
at Router->Illuminate\Routing\{closure}()
in Pipeline.php line 130
at Pipeline->Illuminate\Pipeline\{closure}()
in SubstituteBindings.php …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-6 php-7.4

9
推荐指数
2
解决办法
4万
查看次数

Laravel 7-AWS-Elastic Beanstalk + RDS 运行“php artisan migrate”时出错


我正在尝试在 AWS 上的 Elastic Beanstalk 中运行 Laravel 应用程序。
我在 AWS Elastic Beanstalk 上使用 Laravel 版本 7 和 PHP 7.4。
每次当我尝试运行“php artisan migrate”时,我都会收到此错误:
我的数据库 RDS 凭据全部正确。

照亮\数据库\QueryException

SQLSTATE[HY000] [2002] 连接被拒绝(SQL:select * from information_schema.tables where table_schema = forge and table_name = migrations and table_type
= 'BASE TABLE')

在供应商/laravel/framework/src/Illuminate/Database/Connection.php:671 667| // 如果尝试运行查询时发生异常,我们将格式化错误 668| // 包含与 SQL 的绑定的消息,这将使异常成为 669| // 对开发人员有更多帮助,而不仅仅是数据库错误。670| 捕获(异常 $e){ 671 | 抛出新的 QueryException( 672| $query, $this->prepareBindings($bindings), $e 673| ); 674| } 675|

amazon-web-services amazon-rds laravel amazon-elastic-beanstalk

3
推荐指数
1
解决办法
1978
查看次数