laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.74k stars 291 forks source link

FrankenPHP not supported MongoDB #798

Closed gregsuper closed 8 months ago

gregsuper commented 8 months ago

Octane Version

2.2.6

Laravel Version

10.39.0

PHP Version

8.1.2

What server type are you using?

FrankenPHP

Server Version

v1.0.1

Database Driver & Version

MongoDB 5.0.20

Description

When I run my trial octane server using FrankenPHP, I get the error Class "MongoDB\Driver\Manager" not found. However, a similar octane server using roadrunner works stably without failures (I just restart the server led by roadrunner)

It is worth clarifying that MongoDB is installed correctly, otherwise roadrunner would not work, most likely the problem is in the compatibility of the FrankenPHP server and MongoDB.

A bit of stack error: Class "MongoDB\Driver\Manager" not found {"exception":"[object] (Error(code: 0): Class \"MongoDB\\Driver\\Manager\" not found at /var/www/server.test/vendor/mongodb/mongodb/src/Client.php:117) [stacktrace] #0 /var/www/server.test/vendor/mongodb/laravel-mongodb/src/Connection.php(193): MongoDB\\Client->__construct('mongodb://127.0...', Array, Array) #1 /var/www/server.test/vendor/mongodb/laravel-mongodb/src/Connection.php(64): MongoDB\\Laravel\\Connection->createConnection('mongodb://127.0...', Array, Array) #2 /var/www/server.test/vendor/mongodb/laravel-mongodb/src/MongoDBServiceProvider.php(33): MongoDB\\Laravel\\Connection->__construct(Array) #3 [internal function]: MongoDB\\Laravel\\MongoDBServiceProvider->MongoDB\\Laravel\\{closure}(Array, 'mongodb') #4 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(142): call_user_func(Object(Closure), Array, 'mongodb') #5 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/DatabaseManager.php(101): Illuminate\\Database\\DatabaseManager->makeConnection('mongodb') #6 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1819): Illuminate\\Database\\DatabaseManager->connection('mongodb') #7 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1785): Illuminate\\Database\\Eloquent\\Model::resolveConnection(NULL) #8 /var/www/server.test/vendor/mongodb/laravel-mongodb/src/Eloquent/Model.php(589): Illuminate\\Database\\Eloquent\\Model->getConnection() #9 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1495): MongoDB\\Laravel\\Eloquent\\Model->newBaseQueryBuilder() #10 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1531): Illuminate\\Database\\Eloquent\\Model->newModelQuery() #11 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1484): Illuminate\\Database\\Eloquent\\Model->newQueryWithoutScopes() #12 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2334): Illuminate\\Database\\Eloquent\\Model->newQuery() #13 /var/www/server.test/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2346): Illuminate\\Database\\Eloquent\\Model->__call('where', Array) #48 /var/www/server.test/vendor/laravel/octane/src/ApplicationGateway.php(36): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request)) #49 /var/www/server.test/vendor/laravel/octane/src/Worker.php(84): Laravel\\Octane\\ApplicationGateway->handle(Object(Illuminate\\Http\\Request)) #50 /var/www/server.test/vendor/laravel/octane/bin/frankenphp-worker.php(54): Laravel\\Octane\\Worker->handle(Object(Illuminate\\Http\\Request), Object(Laravel\\Octane\\RequestContext)) #51 [internal function]: {closure}() #52 /var/www/server.test/vendor/laravel/octane/bin/frankenphp-worker.php(75): frankenphp_handle_request(Object(Closure)) #53 /var/www/server.test/public/frankenphp-worker.php(3): require('/var/www/server...')

Output "php -i | grep mongo": /etc/php/8.1/cli/conf.d/20-mongodb.ini, mongodb libmongoc bundled version => 1.25.2 libmongoc SSL => enabled libmongoc SSL library => OpenSSL libmongoc crypto => enabled libmongoc crypto library => libcrypto libmongoc crypto system profile => disabled libmongoc SASL => disabled libmongoc SRV => enabled libmongoc compression => enabled libmongoc compression snappy => disabled libmongoc compression zlib => enabled libmongoc compression zstd => disabled libmongocrypt bundled version => 1.8.2 libmongocrypt crypto => enabled libmongocrypt crypto library => libcrypto mongodb.debug => no value => no value

Output "php -m" also contains mongodb

Steps To Reproduce

Installing pure Laravel 10, Octane, as well as the latest version of the mongodb/laravel-mongodb package; Checking the existence and includes of MongoDB libraries; Connecting to an existing database, and any access to the database with a MongoDB connection.

crynobone commented 8 months ago

most likely the problem is in the compatibility of the FrankenPHP server and MongoDB.

Seem like the issue is within FrankenPHP server and should be reported in the correct repository?