It appears that the mongodb.so extension you're using was compiledBrilliant! Thank you! I just rebuilt the extension ensuring OpenSSL was
against a version of PHP without OpenSSL (i.e. the PHP environment whose
phpize binary was used when building). That resulted in those functions not
being defined during the build. At runtime, the extension is running with a
version of PHP that does have OpenSSL and we were blindly expecting those
functions to exist. I've opened PHPC-698
<https://jira.mongodb.org/browse/PHPC-698> to track the bug and
implemented a fix in PR #324
That said, the fix above is simply going to raise a meaningful exception
in your current scenario (in lieu of the undefined symbol error). You'll
still want to take some action to properly correct this on your end by
doing one of the following:
- Disabling "verify_expiry" option in the SSL context options passed
to MongoDB\Manager\Client. The default stream context (which we use if none
is provided) enables this.
- Rebuilding the extension with the "pecl" and/or "phpize" command
that ships with MAMP.
Specifying SSL context options can be done like so:
$context = stream_context_create(['ssl' => ['verify_expiry' => false]]);
$manager = new MongoDB\Driver\Manager($uri, , ['context' => $context]);
This uses the third $driverOptions argument to the Manager constructor
(or MongoDB\Client in the userland library). At present, the "mongodb"
extension does not have documentation for the SSL context options. I've
opened PHPC-700 <https://jira.mongodb.org/browse/PHPC-700> to track
that. The legacy driver documentation
<http://php.net/manual/en/mongo.context.php> does cover this and links
to the relevant SSL context options (which is a general PHP topic not
specific to our driver) and can be referenced in a pinch. Note that the
custom "mongodb" context is not supported at all in the new driver (that's
specific to some stream logging features that only exist in the legacy
Let me know if you'd like me to clarify any of this further, and thanks
for your patience in the diagnosis.
configured into the PHP environment and that took care of the issue. Thanks
for adding in the exception - that should make it easy to diagnose next
time I forget.
Thanks for all of the help!