Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mosesnagar's avatar

The API wont work anymore...

hey, i had been developed API with lumen. simple one, just one controller with 3-4 methods. It works. But one day it returned some error. we thought is the hosting, but when i tried to using "pure" mysqli - i realized that the problem is on lumen/Elequent. That the error Wrong COM_STMT_PREPARE response size. Received 7 On pure mysqli that returned what i want. It doesnt matter the query, if i want it return a json or save something it both dont work. How to fix it ? I had seen some solutions on stack/google but they are all for Laravel - not for lumen. Help ? :)

0 likes
4 replies
exwi's avatar

Did you try this solution?

Edit your config/database.php and add this line:

'options' => [PDO::ATTR_EMULATE_PREPARES => true,]

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

@exwi That my problem. Soultion for Laravel - but im using lumen. I have no config folder... I tried to use DB facade on booatrap/app.php - to get the connection and then i did setAttribite with that option. Still not working. Same error.

exwi's avatar
exwi
Best Answer
Level 13

@mosesnagar You do have a config folder, its located here:

vendor/laravel/lumen-framework/config/database.php

Please or to participate in this conversation.