简体   繁体   English

MongoDB php驱动程序导致XAMPP OS X上的apache失败

[英]MongoDB php driver causing apache on XAMPP OS X to fail

Since upgrading to Mac OS X El Capitan, if I try to start apache in XAMPP with 'extension=mongo.so' included in the php.ini file, apache fails to start. 自从升级到Mac OS X El Capitan后,如果我尝试使用php.ini文件中包含的'extension = mongo.so'在XAMPP中启动apache,则apache无法启动。 If I remove this, apache starts up fine. 如果我删除它,apache启动正常。 Mongo was installed in my XAMPP build using the pecl command included. 使用包含的pecl命令在我的XAMPP构建中安装了Mongo。 Is this a problem with the new operating system, the driver or XAMPP? 这是新操作系统,驱动程序还是XAMPP的问题?

EDIT: Got the driver working properly on MAMP, the problem must exist in XAMPP 编辑:让驱动程序在MAMP上正常工作,问题必须存在于XAMPP中

From: https://github.com/mongodb/mongo-php-driver/issues/247 来自: https //github.com/mongodb/mongo-php-driver/issues/247

The PHP process loads mongodb.so and libmongoc's _mongoc_do_init() function is executed, which calls sasl_client_init() when compiled with SASL. PHP进程加载mongodb.so并执行libmongoc的_mongoc_do_init()函数,该函数在使用SASL编译时调用sasl_client_init()。 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; 如果在同一进程中多次初始化和销毁​​客户端,我在OS X的早期版本的Cyrus SASL中发现了一些崩溃的引用; however, I'd expect the logic around _mongoc_do_init() ensures that it only executes once per process. 但是,我希望_mongoc_do_init()周围的逻辑确保它每个进程只执行一次。 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. 我也不确定你安装的SASL版本(文件名中包含“2.2”的库),所以我不确定这是不是红鲱鱼。 I will need to follow up with the libmongoc devs to confirm. 我将需要跟进libmongoc devs进行确认。

In the meantime, could you provide a log of your pecl install mongodb? 在此期间,你能提供你的pecl install mongodb的日志吗? There are some lines of interest there related to how SASL is configured (sadly, not the exact version number). 有一些感兴趣的行与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. 此外,如果您手动构建驱动程序,您应该能够使用--with-mongodb-sasl = no参数来配置禁用SASL支持,这可能解决问题,直到我们可以进一步诊断它。 The manual build steps from a shell would be: 从shell手动构建步骤将是:

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

This would also requiring initializing git submodules if you are cloning the repository. 如果要克隆存储库,这还需要初始化git子模块。 Otherwise, you should be able to extract the PECL tgz file and use those sources. 否则,您应该能够提取PECL tgz文件并使用这些源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM