Skip to content

Instantly share code, notes, and snippets.

@mrbenosborne
Created January 26, 2021 15:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrbenosborne/02672702eabdf7343036360d6a845862 to your computer and use it in GitHub Desktop.
Save mrbenosborne/02672702eabdf7343036360d6a845862 to your computer and use it in GitHub Desktop.
Download PHP and Build from Source
#!/bin/bash
PHP_VERSION=$1
WORKDIR=$(pwd)
DOWNLOAD_FILE="php-$PHP_VERSION.tar.gz"
TAR_OUT_DIR="$WORKDIR/php-src-php-$PHP_VERSION"
curl -O -L https://github.com/php/php-src/archive/$DOWNLOAD_FILE
tar -zxvf "$WORKDIR/$DOWNLOAD_FILE"
cd $TAR_OUT_DIR
./buildconf --force
./configure --prefix=/usr/local/php$PHP_VERSION --enable-fpm --disable-short-tags --with-openssl --with-zlib --enable-bcmath --enable-calendar --with-curl --enable-exif --with-gd --enable-intl --enable-mbstring --with-mysqli --enable-pcntl --with-pdo-mysql --enable-soap --enable-sockets --with-xmlrpc --with-password-argon2
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment