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

vch's avatar
Level 1

laravel octane db connection

hello! I am using laravel 10 with octane 2.3.2 + openswoole without octane, my project works fine, but something strange happens on octane from time to time. it seems that something is erasing the connection or pdo and requests start to fall one by one with an error

   INFO  [2024-03-01 06:22:05] production.ERROR: Call to a member function prepare() on null {"exception":"[object] (Error(code: 0): Call to a member function prepare() on null at /vendor/laravel/framework/src/Illuminate/Database/Connection.php:479)

   INFO  [stacktrace]

   INFO  #0 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(809): Illuminate\Database\Connection->Illuminate\Database\{closure}()

   INFO  #1 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(776): Illuminate\Database\Connection->runQueryCallback()

   INFO  #2 /vendor/laravel/framework/src/Illuminate/Database/Connection.php(470): Illuminate\Database\Connection->run()

   INFO  #3 /vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2945): Illuminate\Database\Connection->cursor()

this goes on for a while, about 5-10 minutes, then everything starts working again...

I can't reproduce it, it just seems to happen with octane

Any idea how this can be saved?

0 likes
0 replies

Please or to participate in this conversation.