Build/Install Mongodb PHP MAMP 扩展和 Mac arm64(Big sur)
Build/Install Mongodb PHP extension on MAMP and Mac arm64 (Big sur)
最近切换到 arm64 mac 平台,但由于我遇到问题 installing/building 使用 Mamp 的 mongodb php 扩展。
我尝试了以下方法:
CFLAGS="-arch x86_64" CPPFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" ./configure --target=x86_64
所有可能的变体都使用这些参数,但没有任何效果。
出现以下错误:
[02-Feb-2021 18:09:00 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so, 9): no suitable image found. Did find:
/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so: mach-o, but wrong architecture
/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so: mach-o, but wrong architecture), /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug
-non-zts-20190902/mongodb.so.so, 9): image not found)) in Unknown on line 0
使用 pecl 安装时:CFLAGS="-arch i386" sudo pecl install mongodb-1.5.4
出现以下错误:
[04-Feb-2021 09:10:14 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so, 9): Library not loaded: libicuuc.56.dylib Referenced from: /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so Reason: image not found), /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so.so, 9): image not found)) in Unknown on line 0
有谁成功地完成了我正在尝试做的事情?
设法使用 pecl 安装它:
sudo pecl install -a mongodb
最近切换到 arm64 mac 平台,但由于我遇到问题 installing/building 使用 Mamp 的 mongodb php 扩展。
我尝试了以下方法:
CFLAGS="-arch x86_64" CPPFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" ./configure --target=x86_64
所有可能的变体都使用这些参数,但没有任何效果。
出现以下错误:
[02-Feb-2021 18:09:00 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so, 9): no suitable image found. Did find:
/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so: mach-o, but wrong architecture
/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so: mach-o, but wrong architecture), /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug
-non-zts-20190902/mongodb.so.so, 9): image not found)) in Unknown on line 0
使用 pecl 安装时:CFLAGS="-arch i386" sudo pecl install mongodb-1.5.4
出现以下错误:
[04-Feb-2021 09:10:14 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so, 9): Library not loaded: libicuuc.56.dylib Referenced from: /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so Reason: image not found), /Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so.so (dlopen(/Applications/MAMP/bin/php/php7.4.12/lib/php/extensions/no-debug-non-zts-20190902/mongodb.so.so, 9): image not found)) in Unknown on line 0
有谁成功地完成了我正在尝试做的事情?
设法使用 pecl 安装它:
sudo pecl install -a mongodb