phpbrew
phpbrew copied to clipboard
I am facing the following issue while installing mongo extension in any php 7 & above versions
Output
===> Running make all: /usr/bin/make -C '/Users/tony/.phpbrew/build/php-7.1.4/ext/mongo//' 'all' >> '/Users/tony/.phpbrew/build/php-7.1.4/ext/mongo///build.log' 2>&1
Error: Command failed: /usr/bin/make -C '/Users/tony/.phpbrew/build/php-7.1.4/ext/mongo//' 'all' >> '/Users/tony/.phpbrew/build/php-7.1.4/ext/mongo///build.log' 2>&1 returns:
The last 5 lines in the log file:
#define add_assoc_string(__arg, __key, __str) add_assoc_string_ex(__arg, __key, strlen(__key), __str)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
9 warnings and 20 errors generated.
make: *** [php_mongo.lo] Error 1
Please checkout the build log file for more details:
tail /Users/tony/.phpbrew/build/php-7.1.4/ext/mongo///build.log
Expected Result
Mongo extension installed
Command
phpbrew ext install mongo
Build Log
tail /Users/tony/.phpbrew/build/php-7.1.4/ext/mongo///build.log ^ /Users/tony/.phpbrew/build/php-7.1.4/ext/mongo/php_mongo.c:553:46: error: too many arguments provided to function-like macro invocation add_assoc_string(tagset, name, colon + 1, 1); ^ /Users/tony/.phpbrew/php/php-7.1.4/include/php/Zend/zend_API.h:411:9: note: macro 'add_assoc_string' defined here #define add_assoc_string(__arg, __key, __str) add_assoc_string_ex(__arg, __key, strlen(__key), __str) ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 9 warnings and 20 errors generated. make: *** [php_mongo.lo] Error 1
Platform
OS: OS X 10.13.2
Running PHP: PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
Installing PHP:
PHP 7.1.4 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
Anybody for rescue ?
I install the mongodb extension and it's worked successfully in the installing PHP 7.3
version.
$ phpbrew --debug ext install mongodb
......
===> Installing...
Installing shared extensions: /root/.phpbrew/php/php-7.3.33/lib/php/extensions/no-debug-non-zts-20180731/
Installed extension library: /root/.phpbrew/php/php-7.3.33/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so
===> Extension is installed.
===> Creating config file /root/.phpbrew/php/php-7.3.33/var/db/mongodb.ini.disabled
/root/.phpbrew/php/php-7.3.33/var/db/mongodb.ini.disabled is created.
===> Enabling extension mongodb
[*] mongodb extension is enabled.
Done.
I also notice that the Mongo extension is not maintained anymore.
It should use the mongodb
extension instead.