・2018/07/18
Raspberry Piに PHP 7.2を公式リポジトリからサクッと apt-getでインストールする方法
(PHP7.2をラズパイ公式リポジトリから Raspberry Piに簡単にインストールする方法)
Tags: [Raspberry Pi], [電子工作]
● Raspberry Pi 3 Model Bを遂に購入
Raspberry Pi3 Model B RPI2 RPI3
大人気の CPUボードの Raspberry Piに WiFiと Bluetoothが搭載されたモデルが新発売となりました。
以前から Raspberry Pi 2を買おうかどうか迷っていましたが、Raspberry Pi 3 Model Bの発売を機に購入を決意してラズベリアンになる事にしました。
※ ラズパイの OS Raspbianはバージョンが上がる毎に過去の版と OSの内部の作りが変わり、過去に書かれた製作記事(例えば Raspbian Wheezyの時代の記事)がそのままではエラーが出たりして動かない事が有ります。
※ 当方のホームページのラズパイ記事は全て Raspberry Pi 3 Model Bと Raspbian Jessieの組み合わせで動作確認をしております。
(ただし、将来的に新しい Raspbian OSが出た場合に、当方の Raspbian Jessieを基にした内容がそのままでは動かない可能性が有ります。)
※ 2017/08/16から Raspbian OSは Raspbian Jessieから Raspbian Stretchに変わりました。
※ 2019/06/20から Raspbian OSは Raspbian Stretchから Raspbian Busterに変わりました。
Download Raspbian for Raspberry Pi
ちなみに、歴代のバージョンと名称は
Debian | コードネーム | 年月 | 備考 | (参考)Ubuntuでの該当名称 |
Debian 11 | Bullseye | 2021/08/14~ | 2021/11からラズパイにリリース | Focal Fossa 20.04 LTS ? |
Debian 10 | Buster | 2019/06/20~ | 2019/06からラズパイ4対応 | Bionic 18.04 LTS |
Debian 9 | Stretch | 2017/08/16~ | 2018/03からラズパイ3B+対応 | Xenial 16.04 LTS |
Debian 8 | Jessie | 2015~ | 2016/02からラズパイ3対応 | Trusty 14.04 LTS |
Debian 7 | Wheezy | 2013~2016 | | |
Debian 6.0 | Squeeze | 2011~2014 | | |
Debian GNU/Linux 5.0 | Lenny | 2009~2012 | | |
● Raspberry Piに PHP 7.2を公式リポジトリからサクッと apt-getでインストールする方法
PHP7.2をラズパイ公式リポジトリから Raspberry Piに簡単にインストールする方法
ラズパイの Raspbian Stretch OSは 2018年 7月現在 PHP7.2に対応していませんが、下記の設定をする事で公式の raspbian.orgサーバから PHP 7.2を apt-getでインストールできます。
●公式の raspbian.orgサーバから取得するメリット
※ 第三者のビルドした PHP 7.2を組み込まなくても良い(悪意の有る第三者が配布している場合、ウイルス混入等のおそれがある)
※ PHP 7.2を自分でビルドしなくても良い(ポリシーとして自分でビルドしたい人はそちらでどうぞ。)
公式の Raspbian Repositoryサーバから 2019年リリース予定の時期 OSの "Buster"から PHP 7.2をインストールします。
Raspbian Repository
http://archive.raspbian.org/ Index of /raspbian/dists/buster/
Clean install Rasbian buster
2017/8/28
You're about eighteen months too early. I wouldn't expect to be testing Buster before February 2019 as there will be nothing built for it until there's an early release candidate.
「18ヶ月もはえーよ!」
DougieLawsonさんは並々ならぬサポートで大変だなぁ。
Raspbian Buster
2018/1/28
Q: Raspbian Buster
A: You're about eighteen months too early.
上記の "eighteen months"は時期の計算的にコピペミスでしょうか?
● ラズパイに PHP 7.2をラズパイ公式リポジトリからサクッと apt-getでインストールする方法
# PHP 7.2のパッケージの存在を確認
apt-cache search php7.2
# (何も出てこない)
# sources.listに下記の行を追加する
sudo nano /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ buster main contrib non-free rpi
# 再度 sudo apt-get updateして変更を有効にする
sudo apt-get update
# PHP 7.2のパッケージの存在を確認
apt-cache search php7.2
# (色々出てくる)
# php7.2 - server-side, HTML-embedded scripting language (metapackage)
# PHP 7.2のインストールを一行で一括で行なう場合
sudo apt-get -y install php7.2 php7.2-common php7.2-mbstring php7.2-xml php7.2-mysql php7.2-zip php7.2-gd php7.2-curl php7.2-json mcrypt
# php7.2-mcryptは有りません
# libc-bin
# Configuring libc6:armhf
# PHPのバージョンの確認
pi@raspberrypi:~ $ php -v
[PHP 7.2.4-1+b2 (cli) (built: Apr 5 2018 08:50:27) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.4-1+b2, Copyright (c) 1999-2018, by Zend Technologies
● PHP 7.2をインストール中に libc6パッケージの自動更新を聞いてきます
sudo apt-get -y install php7.2 php7.2-xml php7.2-mbstring php7.2-mysql php7.2-json php7.2-curl php7.2-cli php7.2-common php7.2-gd libapache2-mod-php7.2 php7.2-zip
Package configuration
Configuring libc6:armhf
x There are services installed on your system which need to be restarted x
x when certain libraries, such as libpam, libc, and libssl, are upgraded. x
x Since these restarts may cause interruptions of service for the system, x
x you will normally be prompted on each upgrade for the list of services x
x you wish to restart. You can choose this option to avoid being x
x prompted; instead, all necessary restarts will be done for you x
x automatically so you can avoid being asked questions on each library x
x upgrade. x
x x
x Restart services during package upgrades without asking? x
x x
x <Yes> <No> x
x Running services and programs that are using NSS need to be restarted, x
x otherwise they might not be able to do lookup or authentication any more x
x (for services such as ssh, this can affect your ability to login). x
x Please review the following space-separated list of init.d scripts for x
x services to be restarted now, and correct it if needed. x
x x
x Note: restarting sshd/telnetd should not affect any existing x
x connections. x
x x
x Services to restart for GNU libc library upgrade: x
x x
x ssh cron_________________________________________________________________ x
x x
x <Ok> x
● PHP Fatal error: Uncaught Error: Call to undefined function mb_convert_kana()
PHPに mbstring php-mbstringの拡張モジュールをインストール(追加)する方法。
PHP Fatal error: Uncaught Error: Call to undefined function mb_convert_kana() in /home/pi/mb_test.php:271
Stack trace:
#0 {main}
thrown in /home/pi/mb_test.php on line 271
# 解決方法 phpの mbstring拡張モジュールをインストールする方法
sudo apt install -y php-mbstring
<?php
$test = mb_convert_kana("123 ABC あいう アイウ", "askh");
print($test);
?>
# 実行結果(全部半角文字になります)
123 ABC アイウ アイウ
Tags: [Raspberry Pi], [電子工作]
●関連するコンテンツ(この記事を読んだ人は、次の記事も読んでいます)
Raspberry Piで Googleの Go言語 + Gin Webフレームワークをインストールして Webアプリを作る
Raspberry Piで Googleの Go言語 + Gin Webフレームワークをインストールして Webアプリを作る
Raspberry Piで WebAPIモックサーバー JSON Serverを動かしてみるテスト
Raspberry Piで APIモックサーバー JSON Serverを動かしてみるテスト
Raspberry Piに LAMP構成の Apache MySQL PHP Perl phpMyAdminの Webサーバを構築する方法
ラズパイで一般的な Webサービスを動かす場合に必要なアプリが入った LAMP stackを構築
Raspberry Piに LLMP Lighttpd + MySQL + PHP + Perl 構成の Webサーバを構築する方法
ラズパイで Webサービスを動かす、Lighttpd + PHP + Perl + Python + Ruby CGIの LLMP stackを構築
Raspberry Piに nginx + MySQL + PHP + Perl 構成の LEMP Webサーバを構築する方法
ラズパイで Webサービス LEMP Stackを構築、nginx + PHP + Perl(UNIXドメインソケット方式)
Raspberry Piの Webサーバに PHP MySQL PDOを入れて PHP CGIから MySQLを操作する方法
Raspberry Piの Webサーバに PHP MySQL PDOを入れて PHP CGIから MySQLを操作する方法
Raspberry Pi 3 Model Bで CMSフレームワーク WordPressをセットアップする方法
ラズパイ3で WordPressをインストールする方法
Raspberry Pi3を Gitサーバとして設定する方法、Git単体と GitLabを使用する方法
ラズパイ3でローカルの Gitサーバを動かす方法。GitLabをインストールする方法
Raspberry Pi3に Postfixメールサーバーを Gmailの SMTPをリレーとして立てる方法
Raspbian Jessieで Postfix Mail serverを Gmailの SMTPを中継サーバとして設定する方法
Gitでリモートにプッシュした内容を完全に無かった事にする方法
いわゆる Gitでやらかした時に使える最強奥義 git reset --hard HEAD~; git push -f
Raspberry Piに Avahi Bonjourサービスを入れて、ホスト名で接続できる様にする方法
ラズパイに Bonjourサービスを入れて IPアドレスが分からなくてもホスト名で簡単に接続する方法
Raspberry Piや Jetson NANO等をネットワークに接続した場合の IPアドレスの便利ツール xfinder
DHCPで自動で IPアドレスが割り当てられる場合に、ワンボードマイコンの IPアドレスを調べる場合に便利
Apache Webサーバを過剰なアクセスや DoS攻撃から守る modモジュールの紹介
対 DoS攻撃用の Apache2モジュール mod_evasive、mod_dosdetector、mod_limitipconn、fail2ban等の紹介
Raspberry Pi Zero Wを海外通販の Pimoroni等での購入方法、購入できる通販ショップ一覧まとめ
ラズパイゼロW ワイヤレスモデルを海外通販でサクッと簡単に個人輸入で入手。技適通過でも国内販売は常に品切れ
Raspberry Pi 3で安定して使える相性の無い最適な microSDカードの種類のまとめ
ラズパイ3で安定して使える microSDカードを購入する Teamと SanDiskは絶対に買わない
Raspberry Pi 3 Model Bに専用カメラモジュール RaspiCamを接続する方法
ラズパイに専用カメラモジュールを接続して Raspbianで写真の静止画撮影や動画を録画する方法
Raspberry Pi 3の Linuxコンソール上で使用する各種コマンドまとめ
ラズパイの Raspbian OSのコマンドラインで使用する便利コマンド、負荷試験や CPUシリアル番号の確認方法等も
Raspberry Pi 3公式フォーラムの FAQの内容の日本語訳
ラズパイ公式フォーラムの「The Raspberry Pi 3 Model B Q&A thread」の日本語訳
ラズパイを意識した別物製品 Orange Pi Zeroを買ってみた、Allwinner H2+ Cortex-A7 4core
オレンジパイはラズパイよりもコスパは良いが情報が無いので利用者側に一定のスキルが必要
Orange Pi PC 2を買ってみた、Allwinner H5 Cortex-A53 4core ARM64
ラズパイを意識した別物製品、オレンジパイはラズパイよりもコスパが良い、でも情報が無い
Espressif ESP8266 Arduino互換でスケッチが使える ESP-12Eモジュール基板
Espressif ESP8266 ESP-12-E NodeMCU V1 ESP12 CP2102
BangGood通販はドローン以外にも面白い商品がまだまだ有った(電子工作編)
レーザー彫刻機、カラー液晶の DIYオシロ、Arduinoや Raspberry Pi用の小型カラー液晶
[HOME]
|
[BACK]
リンクフリー(連絡不要、ただしトップページ以外は Web構成の変更で移動する場合があります)
Copyright (c)
2018-2019 FREE WING,Y.Sakamoto
Powered by 猫屋敷工房 & HTML Generator
http://www.neko.ne.jp/~freewing/raspberry_pi/raspberry_pi_php_7_2/