0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

PHP 5.6 の使い方

Last updated at Posted at 2023-09-08

PHP 5.6 を使っているサイトを動かす方法です。
Ubuntu 23.04 に、LXD で Ubuntu 22.04 をインストールしました。

22.04 を使う理由はこちらです。
ppa:ondrej/php on Ubuntu 23.04 (Lunar)

LTS versions でなければ、Ondrej's PPA は使えないということです。

次のページを参考にしました。
Ubuntuのapache2で異なるバージョンのPHPを使用する

Ubuntu 22.04 のインストール

lxc launch ubuntu:22.04 sandbox

環境設定は、こちら
LXD で Ubuntu を使う

PHP 5.6 のインストール

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt upgrade
sudo apt install php5.6
sudo apt install php5.6-cli php5.6-xml php5.6-mysql
sudo apt install php5.6-mbstring

バージョンの確認

$ php --version
PHP 5.6.40-68+ubuntu22.04.1+deb.sury.org+1 (cli) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Apache2 で使われているバージョンの確認

test_a002.php
<?php phpinfo();
?>

ブラウザーでアクセス
image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?