php8.1版本打包二进制运行使用mongodb创建索引报错

touer

问题描述

php8.1版本打包二进制运行使用mongodb创建索引报错,进行打包下载的php8.1.micro.sfx中的mongodb版本过低;

在不打包的情况下运行项目,请求执行创建mongodb索引,只要mongodb版本低于1.15.0就会出现报错

报错信息

Error: Call to undefined method MongoDB\Driver\Manager::getEncryptedFieldsMap() in
phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/mongodb/mongodb/src/functions.php:140<br />
Stack trace:<br />
#0 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/mongodb/mongodb/src/Database.php(278): MongoDB\get_encrypted_fields_from_driver('md_open_db', 'sdk_log_ones202...', Object(MongoDB\Driver\Manager))<br />
#1 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/jenssegers/mongodb/src/Schema/Blueprint.php(259): MongoDB\Database->createCollection('sdk_log_ones202...', Array)<br />
#2 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/jenssegers/mongodb/src/Schema/Builder.php(83): Jenssegers\Mongodb\Schema\Blueprint->create(Array)<br />
#3 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/app/model/mongo/BaseMongo.php(31): Jenssegers\Mongodb\Schema\Builder->create('sdk_log_ones202...', Object(Closure))<br />
#4 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/app/utils/crontabImpl/MongoHandlerImpl.php(64): app\model\mongo\BaseMongo->createIndexes(Array, 'sdk_log_ones202...')<br />
#5 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/app/utils/crontabImpl/MongoHandlerImpl.php(42): app\utils\crontabImpl\MongoHandlerImpl->logCollectionsHandle(Array, Object(app\model\mongo\LogOnesMongo))<br />
#6 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/app/controller/TestController.php(162): app\utils\crontabImpl\MongoHandlerImpl->createLogCollections()<br />
#7 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/webman-framework/src/App.php(325): app\controller\TestController->test(Object(support\Request))<br />
#8 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/webman-framework/src/App.php(349): Webman\App::Webman\{closure}(Object(support\Request))<br />
#9 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/app/middleware/MaintainControl.php(33): Webman\App::Webman\{closure}(Object(support\Request))<br />
#10 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/webman-framework/src/App.php(341): app\middleware\MaintainControl->process(Object(support\Request), Object(Closure))<br />
#11 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/app/middleware/AccessControl.php(19): Webman\App::Webman\{closure}(Object(support\Request))<br />
#12 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/webman-framework/src/App.php(341): app\middleware\AccessControl->process(Object(support\Request), Object(Closure))<br />
#13 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/webman-framework/src/App.php(168): Webman\App::Webman\{closure}(Object(support\Request))<br />
#14 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/workerman/Connection/TcpConnection.php(646): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))<br />
#15 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #700, 2, Resource id #700)<br />
#16 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/workerman/Events/Event.php(193): EventBase->loop()<br />
#17 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/workerman/Worker.php(1629): Workerman\Events\Event->loop()<br />
#18 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/workerman/Worker.php(1423): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))<br />
#19 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/workerman/Worker.php(1397): Workerman\Worker::forkWorkersForLinux()<br />
#20 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()<br />
#21 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/workerman/webman-framework/src/support/App.php(131): Workerman\Worker::runAll()<br />
#22 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/webman/console/src/Commands/StartCommand.php(29): support\App::run()<br />
#23 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/symfony/console/Command/Command.php(312): Webman\Console\Commands\StartCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))<br />
#24 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/symfony/console/Application.php(1022): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))<br />
#25 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/symfony/console/Application.php(314): Symfony\Component\Console\Application->doRunCommand(Object(Webman\Console\Commands\StartCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))<br />
#26 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))<br />
#27 phar:///mnt/e/code/sdk/modosdk_server_new/build/webman.bin/webman(45): Symfony\Component\Console\Application->run()<br />
#28 /mnt/e/code/sdk/modosdk_server_new/build/webman.bin(5): require('phar:///mnt/e/c...')<br />
#29 {main}

版本

webman-framework 1.5.0
php 8.1.19

772 1 0
1个回答

white

我也是

  • white 2023-07-31

    如果解决了,记得分享下

年代过于久远,无法发表回答
×
🔝