访问 phpmyadmin 冲泡

Posted

技术标签:

【中文标题】访问 phpmyadmin 冲泡【英文标题】:Access phpmyadmin brew 【发布时间】:2013-12-16 12:46:13 【问题描述】:

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

我已经通过 brew 安装了 phpmyadminbrew 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

【问题讨论】:

127.0.0.1/phpmyadmin ? 就像我在下面所说的那样,它不起作用! 你能在homebrew install phpmyadmin时粘贴输出吗? 当然,这是我得到的 【参考方案1】:

您需要将以下配置添加到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 ...)

【讨论】:

好的,这似乎让它工作了!我已经设置了 pma 用户名和 pmapass,但它不允许我登录!我是不是忘了别的什么? 终于搞定了,只需更新 mysql.user 并为 root 用户设置新密码!谢谢大家! @jem88 我应该将“config.sample.inc.php”复制到哪里 @icodebuster 如果你是通过 brew 安装的,将其重命名为 config.inc.php,然后复制到“/usr/local/Cellar/phpmyadmin/4.1.11/share/phpmyadmin”(更改版本)。别忘了给你换个秘密河豚,在这里你可以找到更多信息[angelawang.me/programming/…]【参考方案2】:

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

brew tap xy/homebrew-php
brew install phpmyadmin

【讨论】:

【参考方案3】:

如果您运行的是 localhost,通常可以通过http://localhost/phpmyadmin 访问 mysql

【讨论】:

我知道,但访问 localhost/phpmyadmin 时出现 404 错误.. 找不到页面! 你确定你打开了 Apache 和 MySQL 吗?这是正确的 URL,它必须有效。 我想是的,因为访问 localhost 它给了我“它有效!”消息,并从终端执行 mysql -u root mysql 我可以访问 mysql shell ...但我仍然无法访问 localhost/phpmyadmin! 我不知道是否重要,但我想告诉你我已经从brew安装了php,mysql和phpmyadmin,但是我使用的是默认mac的apache跨度>

以上是关于访问 phpmyadmin 冲泡的主要内容,如果未能解决你的问题,请参考以下文章

Wamp phpMyAdmin 密码问题

phpmyadmin 未在 RPi 4 64 位上加载 [重复]

如何从 phpMyAdmin 数据库中查找连接字符串?

Digital Ocean 主机上的 phpMyAdmin 404 错误

phpmyadmin 的 IE 10 和 Firefox 问题

[phpmyadmin] phpmyadmin select command denied to user