mac 初期設定 part7 - Webサーバの構築 phpMyAdminのインストール

外部 formula の josegonzalez/homebrew-php を使います。
先ほど入れたのでここは割愛。

念のため、searchで検索だけしておきます。

$ brew search phpmyadmin

phpmyadmin

 

phpMyAdminをインストールします。

$ brew install phpmyadmin

==> Installing dependencies for phpmyadmin: mcrypt, php54-mcrypt

==> Installing phpmyadmin dependency: mcrypt

==> Downloading http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/

######################################################################## 100.0%

==> ./configure --prefix=/usr/local/Cellar/mcrypt/2.5.8 --mandir=/usr/local/Cell

==> make install

🍺  /usr/local/Cellar/mcrypt/2.5.8: 12 files, 332K, built in 30 seconds

==> Installing phpmyadmin dependency: php54-mcrypt

==> Downloading http://www.php.net/get/php-5.4.24.tar.bz2/from/this/mirror

######################################################################## 100.0%

==> PHP_AUTOCONF="/usr/local/opt/autoconf/bin/autoconf" PHP_AUTOHEADER="/usr/loc

==> ./configure --prefix=/usr/local/Cellar/php54-mcrypt/5.4.24 --with-php-config

==> make

==> Caveats

To finish installing mcrypt for PHP 5.4:

  * /usr/local/etc/php/5.4/conf.d/ext-mcrypt.ini was created,

    do not forget to remove it upon extension removal.

  * Validate installation via one of the following methods:

  *

  * Using PHP from a webserver:

  * - Restart your webserver.

  * - Write a PHP page that calls "phpinfo();"

  * - Load it in a browser and look for the info on the mcrypt module.

  * - If you see it, you have been successful!

  *

  * Using PHP from the command line:

  * - Run "php -i" (command-line "phpinfo()")

  * - Look for the info on the mcrypt module.

  * - If you see it, you have been successful!

==> Summary

🍺  /usr/local/Cellar/php54-mcrypt/5.4.24: 3 files, 56K, built in 21 seconds

==> Installing phpmyadmin

==> Downloading https://github.com/phpmyadmin/phpmyadmin/archive/RELEASE_4_1_4.t

######################################################################## 100.0%

==> Caveats

Note that this formula will NOT install mysql. It is not

required since you might want to get connected to a remote

database server.

 

Webserver configuration example (add this at the end of

your /etc/apache2/httpd.conf for instance) :

  Alias /phpmyadmin /usr/local/share/phpmyadmin

  <Directory /usr/local/share/phpmyadmin/>

    Options Indexes FollowSymLinks MultiViews

    AllowOverride All

    Order allow,deny

    Allow from all

  </Directory>

Then, open http://localhost/phpmyadmin

 

More documentation : file:///usr/local/Cellar/phpmyadmin/4.1.4/share/phpmyadmin/doc/

 

Don't forget to copy config.sample.inc.php to config.inc.php and :

  - change your secret blowfish

  - uncomment the configuration lines (pma, pmapass ...)

 

==> Summary

🍺  /usr/local/Cellar/phpmyadmin/4.1.4: 1532 files, 50M, built in 65 seconds

 

phpMyAdminのバーチャルホスト設定

/usr/local/etc/apache2/httpd.conf のバーチャルホストの設定ファイルをコメントを外して有効化します。

# Virtual hosts
Include /usr/local/etc/apache2/extra/httpd-vhosts.conf

 

バーチャルホストの設定ファイルを編集

/usr/local/etc/apache2/extra/httpd-vhosts.conf でバーチャルホストの設定ファイルを編集します。

元々あったダミーの設定をすべて削除して以下の内容を追加

  Alias /phpmyadmin /usr/local/share/phpmyadmin
  <Directory /usr/local/share/phpmyadmin/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>

 

設定ファイル config.inc.php を作成

/usr/local/Cellar/phpmyadmin/4.1.4/share/phpmyadmin/config.sample.inc.php をコピーして設定ファイル config.inc.php を作成します。

$ cp /usr/local/Cellar/phpmyadmin/4.1.4/share/phpmyadmin/config.sample.inc.php /usr/local/Cellar/phpmyadmin/4.1.4/share/phpmyadmin/config.inc.php

 

ApacheMySQL を再起動。

$ sudo apachectl restart

Password:

$ mysql.server restart

Shutting down MySQL

. SUCCESS! 

Starting MySQL

.. SUCCESS! 

 

http://localhost/phpmyadminにアクセスして、ログインできたらOK!