Unable to install mongodb.so as extension in MAMP PHP

Hi im using MAMP pro 6.8 on a MAC Big sur 11.4. … I have searched and tried a lot of stuff, installing the extension using this guide: MAMP PRO (macOS) Documentation > FAQ > PHP > Install a PHP Extension using PECL.

And also i found several other guides ive tried, i ve tried to install the extension directly in the php version on the Mac and then move the mongodb.so file to the MAMP installation also.

The mongodb.so file is created ok,
Apparently the extension is installed ok, in terminal i get:

Build process completed successfully
Installing '/Applications/MAMP/bin/php/php8.1.13/lib/php/extensions/no-debug-non-zts-20210902/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.17.3
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini

no matter what i do , everytime i enable “extension=mongodb.so” in my php.ini file i get a 500 Error,

I also found this Mac OS: Apache won't start on MAMP after add extension=mongodb.so · Issue #682 · mongodb/mongo-php-driver · GitHub but i didnt find any info i understand that i can apply to my commands so i can install mongodb.so

I really need to enable this extension. Is there anything you recommend i can try? I have looking for this, searching, google, and in stackoverflow with no luck.

Thanks in advance. Sorry if it is the wrong category.

My apache log:

[Wed Mar 20 12:55:20.105502 2024] [fastcgi:error] [pid 46505] [client ::1:50365] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi" aborted: idle timeout (30 sec), referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:20.112565 2024] [fastcgi:error] [pid 46505] [client ::1:50365] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi", referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:25.346007 2024] [fastcgi:error] [pid 46507] [client ::1:50387] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi" aborted: idle timeout (30 sec)
[Wed Mar 20 12:55:25.347311 2024] [fastcgi:error] [pid 46507] [client ::1:50387] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi"
[Wed Mar 20 12:55:44.617717 2024] [fastcgi:error] [pid 46508] [client ::1:50466] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi" aborted: idle timeout (30 sec), referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:44.618951 2024] [fastcgi:error] [pid 46508] [client ::1:50466] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi", referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:49.539529 2024] [fastcgi:error] [pid 46506] [client ::1:50488] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi" aborted: idle timeout (30 sec), referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:49.541013 2024] [fastcgi:error] [pid 46506] [client ::1:50488] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi", referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:50.192926 2024] [fastcgi:error] [pid 46504] [client ::1:50493] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi" aborted: idle timeout (30 sec), referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:50.194002 2024] [fastcgi:error] [pid 46504] [client ::1:50493] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi", referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:55.444058 2024] [fastcgi:error] [pid 46547] [client ::1:50514] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi" aborted: idle timeout (30 sec), referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:55:55.445006 2024] [fastcgi:error] [pid 46547] [client ::1:50514] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi", referer: http://localhost/MAMP/?language=English
[Wed Mar 20 12:57:15.465921 2024] [fastcgi:error] [pid 46537] [client ::1:50854] FastCGI: comm with server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi" aborted: idle timeout (30 sec)
[Wed Mar 20 12:57:15.472653 2024] [fastcgi:error] [pid 46537] [client ::1:50854] FastCGI: incomplete headers (0 bytes) received from server "/Applications/MAMP/fcgi-bin/php8.1.13.fcgi"

[Wed Mar 20 13:24:16.145495 2024] [mpm_prefork:notice] [pid 48695] AH00169: caught SIGTERM, shutting down
[Wed Mar 20 13:24:21.011337 2024] [:notice] [pid 49901] FastCGI: process manager initialized (pid 49901)
[Wed Mar 20 13:24:21.040648 2024] [mpm_prefork:notice] [pid 49900] AH00163: Apache/2.4.54 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141 OpenSSL/1.0.2u mod_wsgi/3.5 Python/2.7.18 configured -- resuming normal operations
[Wed Mar 20 13:24:21.046242 2024] [core:notice] [pid 49900] AH00094: Command line: '/Applications/MAMP/Library/bin/httpd -f /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf'

Update : If anyone is facing this crashes, when installing on Pecl now

You have to choose “no” to use system libraries, also “no” to libbson and libmongoc , When SSL options, i use Darwin, and in use only openssl , i choose no. This make it. Its working now. :slight_smile:

1 Like