hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

i added mongo,but it doesn't work

Open 4-1-1 opened this issue 12 years ago • 13 comments

i add it to the config.hdf file,and restart hhvm, no erroe and no warning DynamicExtensions { mongo = /home/shiyongyong/ext/mongo.so } but the mongo class is still undefined

4-1-1 avatar Apr 14 '14 04:04 4-1-1

https://github.com/10gen-labs/mongo-hhvm-driver

4-1-1 avatar Apr 14 '14 04:04 4-1-1

This repository is experimental, and partially implemented, is WIP, give a try to https://github.com/mongofill/mongofill-hhvm

mcuadros avatar Apr 14 '14 22:04 mcuadros

I have try it,built a file named mongo.so, and reconfig the config.hdf, hhvm - c config.hdf test.php.still tell me ,the mongo class is undefined. oh ,my god.

4-1-1 avatar Apr 15 '14 02:04 4-1-1

@laodalaoda520, try the mongofill extension linked above - it has a pure php and a php/c++ version. The pure php one can be used without having to compile any extension at all and can tell you whether it has the features you need for your application. The -hhvm one adds some performance improvements (e.g. BSON handling).

nubs avatar Apr 15 '14 02:04 nubs

Dupe of #578

fredemmott avatar Apr 15 '14 17:04 fredemmott

this was fixed in a commit 2 days ago in mongofill-hhvm, the build script was not injecting the php classes into the .so correctly. The fix in HEAD on mongofill-hhvm makes it work fine.

Note that hhvm does not seem to load extensions when running as sudo root, this may be a security thing.

thawkins avatar Apr 26 '14 06:04 thawkins

i have try to update mongofill-hhvm.and rebuilt the mongo.so ,but it still not work @thawkins

4-1-1 avatar Apr 27 '14 12:04 4-1-1

Try running "make clean" in the mongofill-hhvm directory, then run build.sh again.

thawkins avatar Apr 27 '14 13:04 thawkins

first,I run git remote update in the mongofill-hhvm directory; then , run make clean ; when the built end,I run the bin ,hhvm -c /etc/hhvm/config.hdf test.php; DynamicExtensions { mongo = /home/hhvm_ext/mongo.so } but,it still undefined; [Mon Apr 28 09:22:36 2014] [hphp] [19992:7f6a1dd1b400:0:000001] [] Fatal error: Class undefined: Mongo in /home/shiyongyong/ext/test.php on line 2 @thawkins

4-1-1 avatar Apr 28 '14 01:04 4-1-1

I kn8w this is a bit obvious, but did you remember to copy the new mongo.so to /home/hhvm_ext

thawkins avatar Apr 28 '14 01:04 thawkins

yes, if i didn't ,the hhvm will not run; @thawkins

4-1-1 avatar Apr 28 '14 01:04 4-1-1

Mongo class is depracated try MongoClient.

Pomyk avatar May 13 '14 10:05 Pomyk

Hi I am using mongo-hhvm-driver it is saying me Fatal error: Class undefined: MongoClient

and also when I am compiling mongofill

/root/hhvm/hhvm-mongodb/mongofill-hhvm/src/bson.cpp:3:0: /usr/local/include/bson.h:64:2: error: #error Must compile with c99 or define MONGO_HAVE_STDINT, MONGO_HAVE_UNISTD, MONGO_USE__INT64, or MONGO_USE_LONG_LONG_INT. #error Must compile with c99 or define MONGO_HAVE_STDINT, MONGO_HAVE_UNISTD, MONGO_USE__INT64, or MONGO_USE_LONG_LONG_INT. ^

this error

SendOTP avatar Oct 29 '15 13:10 SendOTP