Linux 下多php 版本共存安裝
阿新 • • 發佈:2017-06-03
git span can tar yum sta acc pen hang
我們知道apache + php 是比較經典的搭配,但是兩者都會升版,咱家就經歷過兩次php 升版。
一般就是重新下載新版本的php ,然後編譯安裝。這一切都很繁瑣。有沒有自動安裝工具呢?
當然是有的,phpevn 就是linux 下的php 多版本管理工具。下面介紹他的安裝。
安裝方法 參考 https://github.com/phpenv/phpenv
首先git 安裝
$ yum install git
-
Check out phpenv into
~/.phpenv
.$ cd $ git clone git://github.com/phpenv/phpenv.git .phpenv
-
Add
~/.phpenv/bin
to your$PATH
for access to thephpenv
command-line utility.$ echo ‘export PATH="$HOME/.phpenv/bin:$PATH"‘ >> ~/.bash_profile
-
Add phpenv init to your shell to enable shims and autocompletion.
$ echo ‘eval "$(phpenv init -)"‘ >> ~/.bash_profile
-
Restart your shell so the path changes take effect. You can now begin using phpenv.
$ exec $SHELL
-
$ phpenv install php-5.3.20
-
$ phpenv install php-6.5.11
-
php 版本切換 phpenv global php 版本號
Linux 下多php 版本共存安裝