Laravel 5.4 给出了错误的 COM_STMT_PREPARE 响应大小
问题描述
我在一个网站上工作,过去一个月它运行良好,昨天突然崩溃并说 Wrong COM_STMT_PREPARE 响应大小.收到 7
.
I'm working on a website and it worked fine the past month, suddenly yesterday it crashed and says Wrong COM_STMT_PREPARE response size. Received 7
.
这是我在控制器中的代码:
This is my code in the controller:
我还没有找到任何解决方案.任何帮助将不胜感激.
I haven't found any solution. Any help would be greatly appreciated.
更新:
如果它有助于服务器在 000webhost 中,我发现很多人都有同样的问题.
If it helps the server is in 000webhost, I've seen that many people is having the same issue.
更新 2
错误表明问题出在 Connection.php 第 647 行
The error says the problem is in Connection.php line 647
这是围绕它的代码:
和
推荐答案
我通过将 PDO 属性 PDO::ATTR_EMULATE_PREPARES
设置为 true 解决了这个问题.您可以在 config/database.php 下为您的数据库连接添加一个选项.
i solved this issue by setting the PDO attribute PDO::ATTR_EMULATE_PREPARES
to true. you can add an option to your Database Connection under config/database.php.
这篇关于Laravel 5.4 给出了错误的 COM_STMT_PREPARE 响应大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!