LoginSignup
4
8

More than 5 years have passed since last update.

Raspberry Pi で LAMP

Last updated at Posted at 2016-04-28

LAMP の設定

以下のサイトを参考に実施

IT女子のラズベリーパイ入門奮闘記

下準備

$ sudo apt-get update
$ sudo apt-get upgrade

Apache のインストール

$ sudo apt-get install apache2 -y

http://localhost/
apache2.png

補足

  • 再起動
$ sudo service apache2 restart

または

$ sudo apachectl restart
  • 設定ファイルの文法チェック
$ apachectl configtest
Syntax OK

PHP のインストール

$ sudo apt-get install php5 libapache2-mod-php5 -y
/var/www/html/info.php
<?php
    phpinfo();
?>

MySQL のインストール

$ sudo apt-get install mysql-server php5-mysql -y

まとめ

各バージョンは以下のとおり

$ cat /etc/debian_version
8.0
$ cat /etc/issue
Raspbian GNU/Linux 8 \n \l

$
$ apache2 -v
Server version: Apache/2.4.10 (Raspbian)
Server built:   Sep  5 2015 17:38:45
$
$ mysql -V
mysql  Ver 14.14 Distrib 5.5.44, for debian-linux-gnu (armv7l) using readline 6.3
$
$ php -v
PHP 5.6.14-0+deb8u1 (cli) (built: Oct 28 2015 00:02:05)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
$

phpMyAdmin のインストール

以下のサイトを参考に実施
* Debian 8 Jessie LAMP server tutorial with Apache 2, PHP 5 and MariaDB (instead of MySQL)

$ sudo apt-get -y install phpmyadmin

自動再設定する web サーバ: apache2
phpmyadmin のデータベースを dbconfig-common で設定しますか? :はい
データベースの管理権限を持つユーザのパスワード: ********
phpmyadmin 用の MySQL アプリケーションパスワード: そのままEnter

これで自動で設定されるはずだが、エラーが発生

phpMyAdmin_error.png

とりあえず、Apache を再起動

$ sudo service apache2 restart

http://XXX.XXX.XXX.XXX/phpmyadmin/
phpmyadmin.png

phpmyadmin_login.png

設定できているようだ。

4
8
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
4
8