在Mac OS上安装phpMyAdmin的500内部错误

时间:2014-01-31 00:11:25

标签: php mysql apache phpmyadmin

我在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

1 个答案:

答案 0 :(得分:0)

我修好了。我有点慢。这就是我做的。我从htaccess文件中删除了以下内容。因为我猜目录文件并不属于那里。

<Directory /usr/local/phpmyadmin416english>
    Options Indexes
    Order allow,deny
    Allow from all
</Directory>

然后我在我的vhost文件中更改了这个...

<VirtualHost *:80>
        ServerName "phpmyadmin.local"
        ServerAlias "phpmyadmin.local"
        DocumentRoot "/Library/WebServer/Documents/phpmyadmin"
</VirtualHost>

到此

<VirtualHost *:80>
<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>
        ServerName "phpmyadmin.local"
        ServerAlias "phpmyadmin.local"
        DocumentRoot "/usr/local/phpmyadmin416english"
</VirtualHost>

我没有将DocumentRoot指向webroot目录,而是将vhost文件指向那里。如果有人有任何方法,我想知道替代方法。