Skip to content

Instantly share code, notes, and snippets.

@heinthanth
Created September 16, 2020 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heinthanth/bb6544153bcaf6652303ebceff471f3e to your computer and use it in GitHub Desktop.
Save heinthanth/bb6544153bcaf6652303ebceff471f3e to your computer and use it in GitHub Desktop.
Build PHP 8 on macOS.
#!/usr/bin/env bash
brew install pkg-config iconv openssl oniguruma postgresql libzip
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L /usr/local/opt/openssl@1.1/lib -L /usr/local/opt/readline/lib"
export CPPFLAGS="-I /usr/local/opt/openssl@1.1/include -I /usr/local/opt/readline/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig"
./configure --prefix=$HOME/opt/php \
--with-iconv=$(brew --prefix libiconv) \
--enable-mysqlnd \
--with-pdo-mysql \
--with-pdo-mysql=mysqlnd \
--with-pdo-pgsql=/usr/bin/pg_config \
--enable-bcmath \
--enable-fpm \
--with-fpm-user=www-data \
--with-fpm-group=www-data \
--enable-mbstring \
--enable-phpdbg \
--enable-shmop \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-zip \
--with-zlib \
--with-curl \
--with-pear \
--with-openssl \
--enable-pcntl \
--with-readline=$(brew --prefix readline)
make -jN # N = number of core
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment