Skip to content

Segmentation fault when specifying username and password #62

Closed
@syntheticminds

Description

@syntheticminds

Hi there.

I've noticed that when you specify a username and password in the URI and access control isn't being used, a segmentation fault occurs. Try the following script on a Laravel Homestead VM.

<?php

$manager = new MongoDB\Driver\Manager('mongodb://foo:bar@127.0.0.1/test');
$server = $manager->selectServer(new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::RP_PRIMARY));
$server->executeQuery('db.collection', new MongoDB\Driver\Query([]));
# ~/.homestead/after.sh
# MongoDB
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list

sudo apt-get update
sudo apt-get install mongodb-org pkg-config libsasl2-dev -y

sudo pecl install mongodb

echo 'extension=mongodb.so' | sudo tee /etc/php5/mods-available/mongodb.ini
sudo ln -s /etc/php5/mods-available/mongodb.ini /etc/php5/fpm/conf.d/mongodb.ini
sudo ln -s /etc/php5/mods-available/mongodb.ini /etc/php5/cli/conf.d/mongodb.ini

sudo service php5-fpm restart

Not critical but it threw one of the unit tests I was using.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions