At the time of this writing, HHVM does not have a package manager for extensions. Download the latest driver from » GitHub. Alternatively, you may clone the repository to build the latest source code:
$ git clone //github.com/mongodb/mongo-hhvm-driver.git $ cd mongo-hhvm-driver $ git submodule sync && git submodule update --init
Generate the configure
files for the bundled libraries. For this
this to work, you need to have the automake
,
autoconf
, and libtool
packages installed (e.g.
through apt-get
).
$ cd libbson; ./autogen.sh; cd .. $ cd libmongoc; ./autogen.sh; cd ..
Build and install the driver by running:
$ hphpize $ cmake . $ make -j 5 $ sudo make install
Note:
If the
hphpize
command is not available, you will need to either compile HHVM from source or install thehhvm-dev
package (e.g. throughapt-get
).
The last step will report where mongodb.so has been installed, similar to:
Installing: /usr/local/hhvm/3.9.1/lib/hhvm/extensions/20150212/mongodb.so
Add the following line to your php.ini file (usually found in "/etc/hhvm"):
hhvm.dynamic_extension_path=/usr/local/hhvm/3.9.1/lib/hhvm/extensions/20150212 hhvm.dynamic_extensions[mongodb]=mongodb.so