简体   繁体   English

流明错误在第 145 行照亮/support/Arr.php

[英]Lumen error illuminate/support/Arr.php on line 145

In my local development environment its works fine, but when i deploy the lumen(5.2) project in server and when it's try to execute this line app('db')->select($sql, array($email));在我的本地开发环境中,它工作正常,但是当我在服务器中部署lumen(5.2)项目并尝试执行此行时app('db')->select($sql, array($email)); then it's throw this exception然后它抛出这个异常

protected 'message' => string 'array_key_exists(): The first argument  should be either a string or an integer' (length=78)
private 'string' (Exception) => string '' (length=0)
protected 'code' => int 0
protected 'file' => string 
'/usr/src/app/api/vendor/illuminate/support/Arr.php' (length=50)
protected 'line' => int 145
private 'trace' (Exception) => 
array (size=32)
  0 => 
    array (size=4)
      'function' => string 'Laravel\Lumen\Concerns\{closure}' (length=32)
      'class' => string 'Laravel\Lumen\Application' (length=25)
      'type' => string '->' (length=2)
      'args' => 
        array (size=5)
          ...
  1 => 
    array (size=4)
      'file' => string '/usr/src/app/api/vendor/illuminate/support/Arr.php' (length=50)
      'line' => int 145
      'function' => string 'array_key_exists' (length=16)
      'args' => 
        array (size=2)
          ...
  2 => 
    array (size=6)
      'file' => string '/usr/src/app/api/vendor/illuminate/support/Arr.php' (length=50)
      'line' => int 280
      'function' => string 'exists' (length=6)
      'class' => string 'Illuminate\Support\Arr' (length=22)
      'type' => string '::' (length=2)
      'args' => 
        array (size=2)
          ...
  3 => 
    array (size=6)
      'file' => string '/usr/src/app/api/vendor/illuminate/database/DatabaseManager.php' (length=63)
      'line' => int 238
      'function' => string 'get' (length=3)
      'class' => string 'Illuminate\Support\Arr' (length=22)
      'type' => string '::' (length=2)
      'args' => 
        array (size=2)
          ...
  4 => 
    array (size=6)
      'file' => string '/usr/src/app/api/vendor/illuminate/database/DatabaseManager.php' (length=63)
      'line' => int 158
      'function' => string 'getConfig' (length=9)
      'class' => string 'Illuminate\Database\DatabaseManager' (length=35)
      'type' => string '->' (length=2)
      'args' => 
        array (size=1)
          ...
  5 => 
    array (size=6)
      'file' => string '/usr/src/app/api/vendor/illuminate/database/DatabaseManager.php' (length=63)
      'line' => int 68
      'function' => string 'makeConnection' (length=14)
      'class' => string 'Illuminate\Database\DatabaseManager' (length=35)
      'type' => string '->' (length=2)
      'args' => 
        array (size=1)
          ...
  6 => 
    array (size=6)
      'file' => string '/usr/src/app/api/vendor/illuminate/database/DatabaseManager.php' (length=63)
      'line' => int 317
      'function' => string 'connection' (length=10)
      'class' => string 'Illuminate\Database\DatabaseManager' (length=35)
      'type' => string '->' (length=2)
      'args' => 
        array (size=0)
          ...

I think its happen for set up environment in server , Please suggest me what i have to do..我认为它发生在服务器中设置环境,请建议我我必须做什么..

Did you enable error logging on your development machine?您是否在开发机器上启用了错误日志?

Share your code which one is you're using with array_key_exists function.array_key_exists函数共享您正在使用的代码。

Also share your current php version of development & server machine.还分享您当前的 php 版本的开发和服务器机器。

I had the same problem right now.我现在遇到了同样的问题。 I've received an error max_memory_limit, but because of nothing.我收到了一个错误 max_memory_limit,但什么也没有。 In that case WAMP/LAMP/XAMP restart should help.在这种情况下,WAMP/LAMP/XAMP 重启应该会有所帮助。 Mye be helpful for somebody... :)我对某人有帮助... :)

please enable $app->withEloquent();请启用$app->withEloquent(); in bootstrap/app.php .bootstrap/app.php If you are using db, you must do this.如果您使用的是 db,则必须执行此操作。

暂无
暂无

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

相关问题 Laravel:第 384 行的 vendor/laravel/framework/src/Illuminate/Support/Arr.php 中的语法错误 - Laravel:syntax error in vendor/laravel/framework/src/Illuminate/Support/Arr.php on line 384 NotFoundHttpException 在 RouteCollection.php 第 145 行: - NotFoundHttpException in RouteCollection.php line 145: Illuminate \\ Support \\ Manager :: createDriver(),在第87行的C:\\ xampp \\ htdocs \\ api \\ vendor \\ illuminate \\ support \\ Manager.php中调用并定义 - Illuminate\Support\Manager::createDriver(), called in C:\xampp\htdocs\api\vendor\illuminate\support\Manager.php on line 87 and defined PHP致命错误:找不到类“ Illuminate \\ Support \\ ServiceProvider” - PHP Fatal error: Class 'Illuminate\Support\ServiceProvider' not found Laravel Scout,Lumen应用程序为Illuminate \\ Support \\ Manager :: createDriver()提供了[ErrorException]缺少参数1 - Laravel Scout, Lumen application gives [ErrorException] Missing argument 1 for Illuminate\Support\Manager::createDriver() Laravel 8 未定义错误 Illuminate\\Support\\Collection::getArrayableItems() - Laravel 8 undefined error Illuminate\\Support\\Collection::getArrayableItems() Lumen 8 依赖注入 - 无法解析的依赖解析 [参数 #0 [<required> $app ]] 在 class Illuminate\Support\ServiceProvider</required> - Lumen 8 Dependency injection - Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\ServiceProvider 无法使用 Illuminate\Support\Facades\Route 作为 Route,因为该名称已在第 3 行的 /home/laravel/routes/web.php 中使用 - Cannot use Illuminate\Support\Facades\Route as Route because the name is already in use in /home/laravel/routes/web.php on line 3 函数 Illuminate\\Support\\Manager::createDriver() 的参数太少,在 framework/src/Illuminate/Support/Manager.php 中传递了 0 - Too few arguments to function Illuminate\Support\Manager::createDriver(), 0 passed in framework/src/Illuminate/Support/Manager.php Lumen 身份验证错误 - Container.php 行 572 中的 ReflectionException:类请求不存在 - Lumen Authentication error - ReflectionException in Container.php line 572: Class Request does not exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM