Skip to content

Instantly share code, notes, and snippets.

@yusufusta
Last active May 19, 2022 13:37
Show Gist options
  • Save yusufusta/d36983c6b216e1db3667615149ad9b92 to your computer and use it in GitHub Desktop.
Save yusufusta/d36983c6b216e1db3667615149ad9b92 to your computer and use it in GitHub Desktop.
# ubuntu 22.04
function downloadLatestPhp(){
result=$(wget -qO- 'https://www.php.net/releases/index.php?json&max=1')
version_name=$(echo $result | jq -r .[keys[-1]].version)
url=$(echo $result | jq -r .[keys[-1]].source[0].filename)
wget "https://www.php.net/distributions/$url";
tar -xvf $url
cd "php-$version_name"
}
sudo su
apt update -y
apt install -y wget jq build-essential autoconf libtool bison re2c pkg-config tar
downloadLatestPhp
./buildconf
./configure --enable-embed=static --with-layout=GNU --disable-all
make -j8
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment