Skip to content

Instantly share code, notes, and snippets.

@Muqsit
Created March 13, 2018 14:20
Show Gist options
  • Save Muqsit/2d95d9e1e9b499dead5d251371eed3fb to your computer and use it in GitHub Desktop.
Save Muqsit/2d95d9e1e9b499dead5d251371eed3fb to your computer and use it in GitHub Desktop.
#!/bin/bash
# Requirements: curl, sudo, tar, building tools
[ -z "${PREFIX}" ] && PREFIX=/usr/local
[ -w "${PREFIX}" ] || SUDO=sudo
set -e
mkdir -p work
cd work
curl -fsSL https://downloads.php.net/~pollita/php-7.2.3.tar.xz | tar -xJf - --strip-components=1
./configure \
--disable-cgi \
--enable-mbstring \
--enable-bcmath \
--enable-pdo \
--enable-sockets \
--enable-ftp \
--with-curl \
--with-libedit \
--with-openssl \
--with-zlib \
--with-gmp \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-xpm-dir \
--with-freetype-dir \
--with-mysqli \
--without-readline \
--enable-pcntl \
--enable-maintainer-zts \
--prefix="${PREFIX}"
make -j`nproc`
$SUDO make install
$SUDO "${PREFIX}/bin/pecl" install channel://pecl.php.net/pthreads-3.1.6 channel://pecl.php.net/weakref-0.3.3 channel://pecl.php.net/yaml-2.0.2 channel://pecl.php.net/zip-1.15.1
echo "phar.readonly = off
extension = yaml.so
extension = pthreads.so
extension = weakref.so
extension = zip.so
extension = cosmiccore_utils.so
extension = redis.so
extension = pocketmine_chunkutils.so
extension = ds.so
zend_extension = opcache.so
zend.assertions = -1
" | $SUDO tee "${PREFIX}/lib/php.ini" > /dev/null
cd ..
rm -rf work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment