在我的本地开发环境中,它工作正常,但是当我在服务器中部署lumen(5.2)
项目时
当它尝试执行此行app('db')->select($sql, array($email));
时,它会抛出此异常
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)
...
我认为它适用于服务器中的设置环境,请告诉我我必须做的事情。
答案 0 :(得分:0)
您是否在开发计算机上启用了错误日志记录?
分享您使用array_key_exists
功能使用的代码。
同时分享您当前的php版本开发&服务器机器。
答案 1 :(得分:0)
我现在遇到了同样的问题。我收到了错误max_memory_limit,但是因为什么都没有。在这种情况下,WAMP / LAMP / XAMP重启应该会有所帮助。 Mye对某人有帮助...... :)
答案 2 :(得分:0)
请在 $app->withEloquent();
中启用 bootstrap/app.php
。如果您使用的是 db,则必须这样做。