创建Web服务器可写文件夹phpMyAdmin配置文件

时间:2013-10-20 09:20:20

标签: phpmyadmin

我收到了这个问题:

请在phpMyAdmin顶级目录中创建Web服务器可写文件夹配置,如文档中所述。否则您将只能下载或显示它。

我该怎么做才能解决这个问题。我的phpMyAdmin版本是3.5.8.2

3 个答案:

答案 0 :(得分:3)

转到您的phpMyAdmin文件夹,通常是/usr/share/phpMyAdmin以获取更新版本。

创建名为config的文件夹:

cd /usr/share/phpMyAdmin
mkdir config                        # create directory for saving
chmod o+rw config                   # give it world writable permissions - this will be removed once your configuration has been saved on the server [as this directory is required by the application to be removed as a security measure]

生成配置后,您可以将其从config文件夹/usr/share/phpMyAdmin/config.inc.php复制到安装文件夹,或者将其复制到Redhat风格的/etc/phpMyAdmin文件夹。

有点晚了,但这个想法很重要。

  • 仅供参考 - 所有这些信息都可以在phpMyAdmin文档中找到

答案 1 :(得分:2)

在提出原始问题后不久,我遇到了同样的问题。

在我的Ubuntu 14.04服务器上,您需要写入的文件位于/var/lib/phpmyadminconfig.inc.phproot:www-data所有,因此设置组写入标记会修复它:660

我通过修改\usr\share\phpmyadmin\setup\frames\index.inc.php(第48行)中的代码来解决这个问题,其中phpMyAdmin执行检查并报告错误。我犯了错误打印文件路径:

check_config_rw($config_readable, $config_writable, $config_exists);
if (!$config_writable || !$config_readable) {
    $file_path = ConfigFile::getInstance()->getFilePath();
    messages_set(
        'error', 'config_rw', __('Cannot load or save configuration to '.$file_path),
        PMA_lang(__('Please create web server writable folder [em]config[/em] in phpMyAdmin top level directory as described in [doc@setup_script]documentation[/doc]. Otherwise you will be only able to download or display it.'))
    );
}

答案 2 :(得分:-1)

如果您无法在phpMyAdmin的文件夹中创建可写文件夹“config”,这不是一个大问题。您可以将创建的配置下载到文件中,但是您必须能够将下载的config.inc.php放回到phpMyAdmin的文件夹中。

相关问题