[英]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.