【发布时间】:2014-01-31 00:11:24
【问题描述】:
我在我的 Mac 上安装了 phpMyAdmin,但出现以下错误
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
MySQL 已经可以工作了,我已经在我的系统上安装了 php 应用程序。这些是我采取的步骤
我下载了phpMyAdmin-4.1.6-english.zip,解压后移动到/usr/local/phpmyadmin416english,把config.sample.inc.php改成config.inc.php。在config.inc.php 内部,我将$cfg['Servers'][$i]['host'] 的值更改为127.0.0.1。
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = false;
在我的hosts 文件中,我创建了phpmyadmin.local 以指向127.0.0.1
在我的 apache vhost 文件中,我添加了以下内容:
<VirtualHost *:80>
ServerName "phpmyadmin.local"
ServerAlias "phpmyadmin.local"
DocumentRoot "/Library/WebServer/Documents/phpmyadmin"
</VirtualHost>
我在/Library/WebServer/Documents/phpmyadmin 的根目录下的 index.php 文件中做了一个 HELLO WORLD。
然后我创建一个像这样的 .htaccess 文件..
<Directory /usr/local/phpmyadmin416english>
Options Indexes
Order allow,deny
Allow from all
</Directory>
所有这些都是基于本教程http://www.djangoapp.com/blog/2011/07/24/installing-phpmyadmin-on-mac-os-x-lion/
这是我在错误日志中得到的内容
[Thu Jan 30 19:13:07 2014] [alert] [client 127.0.0.1] /Library/WebServer/Documents/phpmyadmin/.htaccess: <Directory not allowed here
【问题讨论】:
-
只需将文件从
/usr/local/phpmyadmin416english移动到/Library/WebServer/Documens/phpmyadmin,您就可以省去很多麻烦 -
是的,但我想让它工作是为了知道如何做 :) 我已经用我在错误日志中找到的信息更新了我的帖子
-
The Directory directive 仅允许在 服务器配置 和 虚拟主机 上下文中
标签: php mysql apache phpmyadmin