简体   繁体   中英

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. If I remove this, apache starts up fine. Mongo was installed in my XAMPP build using the pecl command included. Is this a problem with the new operating system, the driver or XAMPP?

EDIT: Got the driver working properly on MAMP, the problem must exist in XAMPP

From: 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. 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.

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).

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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