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
--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
exit
to 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
brew update
brew edit php
Need find --enable-dba
and add below:
--with-lmdb=#{Formula["lmdb"].opt_prefix}
brew install --build-from-source php
In another terminal tab
php -v
php -i | grep lmdb
If build falls with:
you need to run:
and find
--enable-suexec
and add below:and then: