访问phpmyadmin brew

时间:2013-11-30 13:16:13

标签: apache phpmyadmin

简单的问题,但我很难解决它

我通过brew安装了phpmyadmin brew install phpmyadmin

现在,我的php,apache和mysql工作正常(It Works,和mysql cli),我如何访问phpmyadmin接口?

我尝试http://127.0.0.1/phpmyadmin,但获得了404。

我找不到办法让它发挥作用!

以下是brew install phpmyadmin

的输出
installing dependencies for phpmyadmin: php55, mcrypt, php55-mcrypt
==> Installing phpmyadmin dependency: php55
==> Downloading http://www.php.net/get/php-5.5.6.tar.bz2/from/this/mirror
Already downloaded: /Library/Caches/Homebrew/php55-5.5.6
==> Patching
patching file configure
Hunk #1 succeeded at 39041 (offset 764 lines).
Warning: Backing up all known pear.conf and .pearrc files
Warning: If you have a pre-existing pear install outside
         of homebrew-php, or you are using a non-standard
         pear.conf location, installation may fail.
==> ./configure --prefix=/usr/local/Cellar/php55/5.5.6 --localstatedir=/usr/local/var --sysconfdir=/u
==> make
==> make install
==> /usr/local/Cellar/php55/5.5.6/bin/pear config-set php_ini /usr/local/etc/php/5.5/php.ini
==> Caveats
To enable PHP in Apache add the following to httpd.conf and restart Apache:
    LoadModule php5_module    /usr/local/opt/php55/libexec/apache2/libphp5.so

The php.ini file can be found in:
    /usr/local/etc/php/5.5/php.ini

✩✩✩✩ PEAR ✩✩✩✩

If PEAR complains about permissions, 'fix' the default PEAR permissions and config:
    chmod -R ug+w /usr/local/Cellar/php55/5.5.6/lib/php
    pear config-set php_ini /usr/local/etc/php/5.5/php.ini

✩✩✩✩ Extensions ✩✩✩✩

If you are having issues with custom extension compiling, ensure that
you are using the brew version, by placing /usr/local/bin before /usr/sbin in your PATH:

      PATH="/usr/local/bin:$PATH"

PHP55 Extensions will always be compiled against this PHP. Please install them
using --without-homebrew-php to enable compiling against system PHP.

✩✩✩✩ PHP CLI ✩✩✩✩

If you wish to swap the PHP you use on the command line, you should add the following to ~/.bashrc, 
~/.zshrc, ~/.profile or your shell's equivalent configuration file:

      export PATH="$(brew --prefix josegonzalez/php/php55)/bin:$PATH"
==> Summary
  /usr/local/Cellar/php55/5.5.6: 491 files, 29M, built in 6.4 minutes
==> Installing phpmyadmin dependency: mcrypt
==> Downloading http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.g
######################################################################## 100,0%
==> ./configure --prefix=/usr/local/Cellar/mcrypt/2.5.8 --mandir=/usr/local/Cellar/mcrypt/2.5.8/share
==> make install
  /usr/local/Cellar/mcrypt/2.5.8: 12 files, 348K, built in 34 seconds
==> Installing phpmyadmin dependency: php55-mcrypt
==> Downloading http://www.php.net/get/php-5.5.6.tar.bz2/from/this/mirror
######################################################################## 100,0%
==> PHP_AUTOCONF="/usr/local/opt/autoconf/bin/autoconf" PHP_AUTOHEADER="/usr/local/opt/autoconf/bin/a
==> ./configure --prefix=/usr/local/Cellar/php55-mcrypt/5.5.6 --with-php-config=/usr/local/Cellar/php
==> make
==> Caveats
To finish installing mcrypt for PHP 5.5:
  * /usr/local/etc/php/5.5/conf.d/ext-mcrypt.ini was created,
    do not forget to remove it upon extension removal.
  * 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!
==> Summary
  /usr/local/Cellar/php55-mcrypt/5.5.6: 3 files, 56K, built in 99 seconds
==> Installing phpmyadmin
==> Downloading http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/4.0.9/phpMyAdmin-4.0.9
######################################################################## 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.0.9/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.0.9: 1173 files, 28M, built in 40 seconds

3 个答案:

答案 0 :(得分:6)

您需要将以下配置添加到httpd.conf,如brew install的输出中所述。

示例路径:/etc/apache2/httpd.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>

然后重启Apache。

另外,配置:

Don't forget to copy config.sample.inc.php to config.inc.php and :
  - change your secret blowfish
  - uncomment the configuration lines (pma, pmapass ...)

答案 1 :(得分:0)

如果您正在运行localhost,通常可以通过http://localhost/phpmyadmin

访问mysql

答案 2 :(得分:0)

也许你根本没有安装phpmyadmin。您应该尝试以下方法:

brew tap xy/homebrew-php
brew install phpmyadmin