Skip to content

Instantly share code, notes, and snippets.

@JackNoordhuis
Last active April 4, 2019 12:18
Show Gist options
  • Save JackNoordhuis/6c023d7faaa776317123e44af99c9116 to your computer and use it in GitHub Desktop.
Save JackNoordhuis/6c023d7faaa776317123e44af99c9116 to your computer and use it in GitHub Desktop.
Compile a PocketMine-MP compatible php binary with phpbrew.
PHP_VERSION="7.3.3"
[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc
#
# Execute the compile command
#
phpbrew install -j 12 $PHP_VERSION +neutral -- \
--with-curl="$(brew --prefix curl)" \
--with-zlib="$(brew --prefix zlib)" \
--with-gmp="$(brew --prefix gmp)" \
--with-openssl="$(brew --prefix openssl)" \
--with-gd=shared \
--enable-gd-natf --with-jpeg-dir="$(brew --prefix libjpeg)" --with-png-dir="$(brew --prefix libpng)" --with-bz2="$(brew --prefix bzip2)" \
--enable-mbstring \
--enable-calendar \
--enable-mbstring \
--enable-libxml --enable-xml --enable-simplexml \
--disable-fileinfo \
--disable-xmlreader \
--disable-xmlwriter \
--disable-cgi \
--disable-phpdbg \
--disable-session \
--disable-pdo \
--without-pear \
--without-iconv \
--without-pdo-sqlite \
--with-pic \
--enable-dom \
--enable-phar \
--enable-ctype \
--enable-sockets \
--enable-shared=no \
--enable-static=yes \
--enable-shmop \
--enable-maintainer-zts \
--disable-short-tags \
--enable-pcntl \
--enable-embedded-mysqli --enable-mysqlnd --with-mysqli=mysqlnd \
--enable-bcmath \
--enable-cli \
--enable-zip \
--enable-ftp \
--enable-opcache=no \
as "pocketmine-$PHP_VERSION"
phpbrew use "pocketmine-$PHP_VERSION"
#
# Install required extensions
#
phpbrew ext install github:pmmp/pthreads 17c9966bac59211da0705166fc0ecb5ecbc96a0d -- --enable-pthreads
phpbrew ext install github:php/pecl-file_formats-yaml 2.0.4 -- --with-yaml="$(brew --prefix libyaml)"
phpbrew ext install github:igbinary/igbinary 2.0.8 -- --enable-igbinary
phpbrew ext install github:php-ds/ext-ds 4bb4be24ce9835ca81be2e48f0104683e41bce12 -- --enable-igbinary
phpbrew ext install github:pmmp/ext-recursionguard d6ed5da49178762ed81dc0184cd34ff4d3254720 -- --enable-recursionguard
phpbrew ext install github:dktapps/PocketMine-C-ChunkUtils master -- --enable-pocketmine-chunkutils
phpbrew ext install github:bukka/php-crypto 5f26ac91b0ba96742cc6284cd00f8db69c3788b2 -- --with-crypto --with-openssl="$(brew --prefix openssl)"
phpbrew ext install github:pmmp/ext-chunkutils2 c94e9c7e1f059b3f89bd50aaa72a7675ca6d38e3 -- --enable-chunkutils-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment