简体   繁体   English

在HHVM中加载php扩展名

[英]Load php extension in HHVM

I wanted to use hhvm to speed up the process of installing composer updates. 我想使用hhvm来加快安装作曲家更新的过程。 Everything was fine until I wanted to install doctrine/mongodb-odm, which requires the mongodb php extension. 在我想要安装doctrine / mongodb-odm之前,一切都很好,这需要mongodb php扩展。 I get the following output: 我得到以下输出:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/mongodb-odm 1.0.x-dev requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.2.x-dev, 1.1.5, 1.1.x-dev].
    - doctrine/mongodb-odm 1.0.x-dev requires doctrine/mongodb >=1.1.5,<2.0 -> satisfiable by doctrine/mongodb[1.2.x-dev, 1.1.5, 1.1.x-dev].
    - doctrine/mongodb 1.2.x-dev requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.1.x-dev requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.1.5 requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
    - doctrine/mongodb 1.2.x-dev requires ext-mongo >=1.2.12,<1.6-dev -> the requested PHP extension mongo is missing from your system.
    - Installation request for doctrine/mongodb-odm 1.0.x-dev -> satisfiable by doctrine/mongodb-odm[1.0.x-dev].

If I run composer update using just php-cli, it works fine (as I have the mongo extension installed). 如果我仅使用php-cli运行composer update,它就可以正常工作(因为我安装了mongo扩展名)。 But hhvm is not detecting the extension. 但是hhvm没有检测到扩展名。

I've tried adding the following line to the hhvm php.ini without any luck (both like this and with full path) 我尝试将以下行添加到hhvm php.ini中,但没有任何运气(都像这样并具有完整路径)

extension=mongo.so

Is there a way to use it? 有没有办法使用它? Or should I use it just for dependencies that not require php extensions? 还是应该仅将其用于不需要php扩展名的依赖项?

HHVM uses a different set of extensions than the regular PHP, so you have two options: HHVM使用的扩展集与常规PHP不同,因此您有两个选择:

If you are just using HHVM for composer, and so don't need Mongo available to HHVM directly, you can use composer's --ignore-platform-reqs option which will skip that particular check. 如果您只是将HHVM用于作曲家,因此不需要将Mongo直接用于HHVM,则可以使用作曲家的--ignore-platform-reqs选项,该选项将跳过该特定检查。

Alternatively, as has been mentioned there are HHVM Mongo extensions emerging, but they aren't fully featured or mature yet so if you are only using composer then it's a lot of extra effort for no real gain. 另外,正如已经提到的那样,出现了HHVM Mongo扩展,但是它们还没有完全功能齐全或成熟,因此,如果您仅使用作曲家,那么您会付出很多额外的努力而没有真正的收获。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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