This method is suitable for compiling PHP from the source code not only for LMDB, but also through it you can perform any kind of configuration before installation.
Unfortunately, it is currently not possible to change the database size and it is fixed at a size of 1MB (this restriction is defined in the library itself). To get around this, you need to patch the library itself before installation. Look here as: https://gist.github.com/saippuakauppias/95b6f7b139b3d117b7dac4aeead9f5b4
Proper way (not worked)
Build php7 from sources
--interactive: Download and patch formula, then open a shell. This allows the user to run ./configure --help and otherwise determine how to turn the software package into a Homebrew package.
brew install --build-from-source --interactive php
==> Installing php ==> Downloading https://www.php.net/distributions/php-7.3.11.tar.xz ==> Patching patching file acinclude.m4 Hunk #5 succeeded at 2504 (offset 85 lines). ==> Entering interactive mode Type
exitto return and finalize the installation Install to this prefix: /usr/local/Cellar/php/7.3.11 ➜ php-7.3.11 #
./configure --with-lmdb=/usr/local/opt/lmdb # ??? # need more args in `configure` or `make install`? make make test exit
Update brew & patch formula
brew update brew edit php
--enable-dba and add below:
Build from sources
brew install --build-from-source php
In another terminal tab
php -v php -i | grep lmdb