記事内に広告有

macOS(15.2)SequoiaでMAMP:[Homebrew]PhpMyAdminのインストール

未分類

前の記事「macOS(15.2)SequoiaでMAMP:[Homebrew]の再インストール」の関連記事(末尾にリンク掲載)で「新しいiMac(Sequoia, Apple M4)」にApache、PHP、MariaDBをインストールしてMAMP環境を構築しました。この記事では、MAMP環境構築後にデータベース作成用としてphpMyAdminを追加インストールした際のログを記載しています。

[HomeBrew]phpMyAdminのインストール

「brew install phpmyadmin」コマンドで「phpmyadmin」をインストールしました。

% brew install phpmyadmin
:
==> Caveats
To enable phpMyAdmin in Apache, add the following to httpd.conf and
restart Apache:
    Alias /phpmyadmin /opt/homebrew/share/phpmyadmin
    <Directory /opt/homebrew/share/phpmyadmin/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
        <IfModule !mod_authz_core.c>
            Order allow,deny
            Allow from all
        </IfModule>
    </Directory>
Then open http://localhost/phpmyadmin
The configuration file is /opt/homebrew/etc/phpmyadmin.config.inc.php
==> Summary
 /opt/homebrew/Cellar/phpmyadmin/5.2.1: 4,192 files, 48.1MB
==> Running `brew cleanup phpmyadmin`...
:

Apachの設定(httpd.conf)

エディタ(nano)をroot権限で使用(sudo)して「httpd.conf」の修正を行いました。

% sudo nano /opt/homebrew/etc/httpd/httpd.conf
「httpd.conf」への追記内容

「httpd.conf」の末尾に以下を追記しました。

Alias /phpmyadmin /opt/homebrew/share/phpmyadmin
<Directory /opt/homebrew/share/phpmyadmin/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    <IfModule mod_authz_core.c>
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Allow from all
    </IfModule>
</Directory>

phpMyAdminの設定(「phpmyadmin.config.inc.php」の編集)

エディタ(nano)をroot権限で使用(sudo)して「/opt/homebrew/etc/phpmyadmin.config.inc.php」を編集しました。

% sudo nano /opt/homebrew/etc/phpmyadmin.config.inc.php

$cfg[‘blowfish_secret’] に適当な語句を設定しました。

/**
 * This is needed for cookie based authentication to encrypt the cookie.
 * Needs to be a 32-bytes long string of random bytes. See FAQ 2.10.
 */
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

phpMyAdminの動作確認

「brew services restart httpd」コマンドで、httpdを再起動しました。

% brew services restart httpd
Stopping `httpd`... (might take a while)
==> Successfully stopped `httpd` (label: homebrew.mxcl.httpd)
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
%

ブラウザで「https://localhost/phpmyadmin/」にアクセスして、MySQLの「ユーザ名」と「パスワード」で管理画面にログインしました。『phpMyAdmin環境保管領域が完全に設定されていないため、いくつかの拡張機能が無効になっています。』と警告されました。『理由についてはこちら』のリンクに飛んで、phpMyAdmin環境保管領域をセットアップしてphpMyAdminのインストールを完了しました。

macOS(15.1)SequoiaでMAMP:関連記事

コメント

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