简体   繁体   English

无法在Ubuntu 16.04上加载PHP7 mongodb驱动程序

[英]Cannot load PHP7 mongodb driver on Ubuntu 16.04

I have Ubuntu 16.04 and only pre-installed PHP7 on it. 我有Ubuntu 16.04并且只预装了PHP7。 So, I have normally installed and started MongoDB 3.2, but cannot run php driver. 所以,我通常已经安装并启动了MongoDB 3.2,但无法运行php驱动程序。

pecl install mongodb pecl安装mongodb

works correct and currently shows that mongodb 1.2.0 driver is already installed. 工作正常,目前显示已经安装了mongodb 1.2.0驱动程序。 I have of course added " extension=mongodb.so " to php.ini file. 我当然在php.ini文件中添加了“ extension = mongodb.so ”。 So, php -v prints an error: 所以, php -v会输出错误:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mongodb.so' - /usr/lib/php/20151012/mongodb.so: undefined symbol: php_json_serializable_ce in Unknown on line 0
PHP 7.0.13-1+deb.sury.org~xenial+1 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.13-1+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans

I read all SO answers about it, tried to google any information, but still no result. 我阅读了有关它的所有SO答案,试图谷歌任何信息,但仍然没有结果。 All github opened issues with some kind of this type of error are also contain no answer. 所有github打开的问题与某种类型的这种错误也没有答案。

So, how to make it work? 那么,如何让它发挥作用? Thank you in advance. 先感谢您。

There is an issue with json extension. json扩展存在问题。 Take a look at https://github.com/php-ds/extension/issues/2 it must help you 看看https://github.com/php-ds/extension/issues/2它必须帮助你

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

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