错误的COM_STMT_PREPARE响应大小.收到7. LARAVEL ERROR [英] Wrong COM_STMT_PREPARE response size. Received 7. LARAVEL ERROR

查看:769
本文介绍了错误的COM_STMT_PREPARE响应大小.收到7. LARAVEL ERROR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用laravel开发的博客.在我的本地PC上,一切正常.但是,当我将其上传到实时共享托管服务器中时,它会引发如下错误:

I have a blog that is developed using laravel. In my local PC, everything is okay. But when I upload it in live shared hosting server it throws error like below:

ErrorException in MySqlConnector.php line 124:
Wrong COM_STMT_PREPARE response size. Received 7

我的服务器配置在下面给出

My server configuration is given below

  1. 服务器:MariaDB
  2. 服务器版本:10.1.20-MariaDB-MariaDB服务器
  3. PHP 5.6
  1. Server: MariaDB
  2. Server version: 10.1.20-MariaDB - MariaDB Server
  3. PHP 5.6

我找不到任何解决方案.任何帮助将不胜感激.

I could not find any solution. Any help would be greatly appreciated.

推荐答案

我也遇到了同样的问题.我的虚拟主机提供商是000webhost.只需在数据库配置文件(config/database.php)中将此PDO属性PDO::ATTR_EMULATE_PREPARES设置为true,就可以正常工作.

I also faced the same problem. My web host provider was 000webhost. Just set this PDO attribute PDO::ATTR_EMULATE_PREPARES to true in your database config file (config/database.php) and it should work fine.

例如:

'mysql' => [
    'driver' => 'mysql',
    'host' => env('DB_HOST', 'localhost'),
    //.......
    'options'   => [PDO::ATTR_EMULATE_PREPARES => true,]
],

这篇关于错误的COM_STMT_PREPARE响应大小.收到7. LARAVEL ERROR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆