Ubuntu16 php7.1 インストール

php7.1 と関連パッケージをインストール

Ubuntu16にphp7.0(?)しかなく、php7.1を入れたときのメモ

Ubuntu18にphp,composer,larabel入れたときのメモは
ココにまとめた。

sudo apt install software-properties-common
sudo add-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.1 php7.1-fpm php7.1-mysql php7.1-mbstring php7.1-zip php7.1-xml
# Suggested packages:
#   php-pear
# The following NEW packages will be installed:
#   libssl1.1 php7.1 php7.1-cli php7.1-common php7.1-fpm php7.1-json php7.1-mbstring php7.1-mysql php7.1-opcache php7.1-readline php7.1-xml php7.1-zip

 

php7.0に戻す場合

update-alternatives --list php
update-alternatives --display php
update-alternatives --set php /usr/bin/php7.0

# php は /usr/bin/php → /etc/alternatives/php → /usr/bin/php7.1
# のように、シンボリックを呼んでおり、
# update-alternatives --set php で切り替えれる。

which php
/usr/bin/php

ls -al /usr/bin/php
lrwxrwxrwx 1 root root 21  5月 24 15:13 /usr/bin/php -> /etc/alternatives/php*

ls -al /etc/alternatives/php*
lrwxrwxrwx 1 root root 15  5月 31 16:40 /etc/alternatives/php -> /usr/bin/php7.1*
lrwxrwxrwx 1 root root 31  5月 31 16:40 /etc/alternatives/php.1.gz -> /usr/share/man/man1/php7.1.1.gz

 

参考にしたとこ

403 Forbidden

コメント

タイトルとURLをコピーしました