编译错误 Mongo ext PHP 7 通过 PECL
Compilation error Mongo ext PHP 7 via PECL
我尝试通过执行 [=14] 通过 PECL 安装 Mongo PHP 扩展(对于 PHP 7.0.5-4+donate.sury.org~xenial+1) =]
sudo pecl install mongo-1.6.11
我尝试以这种方式安装它,因为我的 Synfony3 项目需要它(执行 composer install 并安装 MongoDB ODM)。
过程的所有开始都做得很好但是在编译部分我有那个错误:
/tmp/pear/temp/mongo/php_mongo.c:736:3: error: too many arguments to function ‘zend_hash_copy’
zend_hash_copy(Z_ARRVAL_P(error_doc), Z_ARRVAL_P(document), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
你能帮我解决这个问题吗?我运行 Kubuntu 16.04下的开发网站
旧版驱动程序(即 Mongo)不适用于 PHP 7,只有新驱动程序(即 MongoDB)可以与新的 PHP 一起使用(参见compatibility table). Supposing you have meant Doctrine's MongoDB ODM you still can use it, just need to combine new driver with a polyfill for the old one, I would suggest taking a look at mongo-php-adapter.
您还可以在 this ODM blogpost 中找到更多信息。
我尝试通过执行 [=14] 通过 PECL 安装 Mongo PHP 扩展(对于 PHP 7.0.5-4+donate.sury.org~xenial+1) =]
sudo pecl install mongo-1.6.11
我尝试以这种方式安装它,因为我的 Synfony3 项目需要它(执行 composer install 并安装 MongoDB ODM)。
过程的所有开始都做得很好但是在编译部分我有那个错误:
/tmp/pear/temp/mongo/php_mongo.c:736:3: error: too many arguments to function ‘zend_hash_copy’
zend_hash_copy(Z_ARRVAL_P(error_doc), Z_ARRVAL_P(document), (copy_ctor_func_t) zval_add_ref, NULL, sizeof(zval *));
你能帮我解决这个问题吗?我运行 Kubuntu 16.04下的开发网站
旧版驱动程序(即 Mongo)不适用于 PHP 7,只有新驱动程序(即 MongoDB)可以与新的 PHP 一起使用(参见compatibility table). Supposing you have meant Doctrine's MongoDB ODM you still can use it, just need to combine new driver with a polyfill for the old one, I would suggest taking a look at mongo-php-adapter.
您还可以在 this ODM blogpost 中找到更多信息。