PHP

PPG007 ... 2022-9-13 Less than 1 minute

# PHP

use phpenv (opens new window) to manage php versions

git clone git@github.com:phpenv/phpenv.git ~/.phpenv
echo 'export PATH="$HOME/.phpenv/bin:$PATH"' >> ~/.zshrc # for zsh
echo 'eval "$(phpenv init -)"' >> ~/.zshrc # for zsh
# restart shell
git clone https://github.com/php-build/php-build $(phpenv root)/plugins/php-build
phpenv install [any php version] # eg: phpenv install 8.1.0
phpenv rehash
phpenv global 8.1.0
1
2
3
4
5
6
7
8

Maybe there are several dependencies that your system not satisfied, just google. You can also try phpenv-installer (opens new window).

There are some, maybe you need install more:

sudo apt \
	install \
	buildconf \
	autoconf \
	build-essential \
	bison \
	re2c \
	pkg-config \
	libxml2-dev \
	openssl \
	openssh-client \
	openssl \
	libssl-dev \
	sqlite3 \
	libsqlite3-dev \
	zlib1g-dev \
	libbz2-dev \
	libcurl4-openssl-dev \
	libpng-dev \
	libjpeg-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Last update: September 13, 2022 01:55
Contributors: Koston Zhuang