且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MongoDB PHP驱动程序导致XAMPP OS X上的Apache失败

更新时间:2022-12-01 11:00:19

发件人: PHP进程加载mongodb.so,并执行libmongoc的_mongoc_do_init()函数,该函数在使用SASL编译时将调用sasl_client_init().如果在同一过程中多次初始化和销毁​​客户端,我会在OS X的Cyrus SASL的早期版本中发现一些有关崩溃的参考.但是,我希望_mongoc_do_init()周围的逻辑可以确保每个进程仅执行一次.我也不确定您安装的SASL版本(除了库中文件名中带有"2.2"之外),因此我不确定这是否是红色鲱鱼.我将需要跟libmongoc开发人员进行跟进,以确认.

The PHP process loads mongodb.so and libmongoc's _mongoc_do_init() function is executed, which calls sasl_client_init() when compiled with SASL. I found some references to crashes in earlier versions of Cyrus SASL on OS X if the client is initialized and destroyed multiple times in the same process; however, I'd expect the logic around _mongoc_do_init() ensures that it only executes once per process. I'm also not sure of the version of SASL you have installed (beyond the library having "2.2" in its filename), so I'm not sure if that is a red herring. I will need to follow up with the libmongoc devs to confirm.

在此期间,您能否提供pecl安装mongodb的日志?有一些有趣的方面与SASL的配置方式有关(不幸的是,不是确切的版本号).

In the meantime, could you provide a log of your pecl install mongodb? There are some lines of interest there related to how SASL is configured (sadly, not the exact version number).

此外,如果您手动构建驱动程序,则应该能够使用--with-mongodb-sasl = no参数配置为禁用SASL支持,这可能会解决该问题,直到我们进一步诊断为止.从外壳手动构建的步骤将是:

Also, if you manually build the driver, you should be able to use the --with-mongodb-sasl=no argument to configure to disable SASL support, which may work around the issue until we can diagnose it further. The manual build steps from a shell would be:

$ cd /path/to/mongo-php-driver
$ phpize
$ ./configure --with-mongodb-sasl=no
$ make clean && make all && make install

如果要克隆存储库,这还需要初始化git子模块.否则,您应该能够提取PECL tgz文件并使用这些源.

This would also requiring initializing git submodules if you are cloning the repository. Otherwise, you should be able to extract the PECL tgz file and use those sources.