phpmyadmin 5.1.0.RC1 &5.0.4 错误(./libraries/classes/Config.php#1285 mkdir() 中的警告:权限被拒绝) [英] Phpmyadmin 5.1.0.RC1 & 5.0.4 error (Warning in ./libraries/classes/Config.php#1285 mkdir(): Permission denied)

查看:67
本文介绍了phpmyadmin 5.1.0.RC1 &5.0.4 错误(./libraries/classes/Config.php#1285 mkdir() 中的警告:权限被拒绝)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ubuntu 服务器 20.04 上测试了 phpmyadmin 5.0.4 和 5.1.0.RC1,出现以下错误:

I test phpmyadmin 5.0.4 and 5.1.0.RC1 on ubuntu server 20.04, and I'm geeting the following error :

Warning in ./libraries/classes/Config.php#1285
 mkdir(): Permission denied
Backtrace

./libraries/classes/Config.php#1285: mkdir(
string '/usr/share/phpmyadmin//var/lib/phpmyadmin/tmp/twig',
integer 504,
boolean true,
)
./libraries/classes/Template.php#57: PhpMyAdmin\Config->getTempDir(string 'twig')
./libraries/classes/Theme.php#101: PhpMyAdmin\Template->__construct()
./libraries/classes/Theme.php#174: PhpMyAdmin\Theme->__construct()
./libraries/classes/ThemeManager.php#307: PhpMyAdmin\Theme::load(
string './themes/pmahomme',
string '/usr/share/phpmyadmin/./themes/pmahomme/',
)
./libraries/classes/ThemeManager.php#79: PhpMyAdmin\ThemeManager->loadThemes()
./libraries/classes/ThemeManager.php#121: PhpMyAdmin\ThemeManager->__construct()
./libraries/classes/ThemeManager.php#385: PhpMyAdmin\ThemeManager::getInstance()
./libraries/common.inc.php#232: PhpMyAdmin\ThemeManager::initializeTheme()
./index.php#15: require_once(./libraries/common.inc.php)

我已经尝试通过 www-data(原始twig")更改我的 ./libraries/classes/Config.php 和/var/lib/phpmyadmin/tmp/twig(也创建了这个文件夹twig")的所有者.root"),但错误未解决.

I've try to change owner of my ./libraries/classes/Config.php and /var/lib/phpmyadmin/tmp/twig (created this folder "twig" too) by www-data (original "root"), but error wasn't resolved.

我的供应商配置是:

<?php
/**
 * File for vendor customization, you can change here paths or some behaviour,
 * which vendors such as Linux distributions might want to change.
 *
 * For changing this file you should know what you are doing. For this reason
 * options here are not part of normal configuration.
 */

declare(strict_types=1);

// phpcs:disable PSR1.Files.SideEffects
if (! defined('PHPMYADMIN')) {
    exit;
}
// phpcs:enable

/**
 * Path to vendor autoload file. Useful when you want to
 * have have vendor dependencies somewhere else.
 */
define('AUTOLOAD_FILE', ROOT_PATH . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');

/**
 * Directory where cache files are stored.
 */
define('TEMP_DIR', ROOT_PATH . '/var/lib/phpmyadmin/tmp/' . DIRECTORY_SEPARATOR);

/**
 * Path to changelog file, can be gzip compressed. Useful when you want to
 * have documentation somewhere else, eg. /usr/share/doc.
 */
define('CHANGELOG_FILE', ROOT_PATH . 'ChangeLog');

/**
 * Path to license file. Useful when you want to have documentation somewhere
 * else, eg. /usr/share/doc.
 */
define('LICENSE_FILE', ROOT_PATH . 'LICENSE');

/**
 * Directory where SQL scripts to create/upgrade configuration storage reside.
 */
define('SQL_DIR', ROOT_PATH . 'sql' . DIRECTORY_SEPARATOR);

/**
 * Directory where configuration files are stored.
 * It is not used directly in code, just a convenient
 * define used further in this file.
 */
define('CONFIG_DIR', '/etc/phpmyadmin/');

/**
 * Filename of a configuration file.
 */
define('CONFIG_FILE', CONFIG_DIR . 'config.inc.php');

/**
 * Filename of custom header file.
 */
define('CUSTOM_HEADER_FILE', CONFIG_DIR . 'config.header.inc.php');

/**
 * Filename of custom footer file.
 */
define('CUSTOM_FOOTER_FILE', CONFIG_DIR . 'config.footer.inc.php');

/**
 * Default value for check for version upgrades.
 */
define('VERSION_CHECK_DEFAULT', true);

/**
 * Path to files with compiled locales (*.mo)
 */
define('LOCALE_PATH', ROOT_PATH . 'locale' . DIRECTORY_SEPARATOR);

/**
 * Define the cache directory for routing cache an other cache files
 */
define('CACHE_DIR', ROOT_PATH . 'libraries' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR);

我使用 php8.0.

and i work with php8.0.

感谢您的支持!

推荐答案

启用模板缓存.编辑 /usr/share/webapps/phpMyAdmin/config.inc.php 以添加以下行:

Enable template caching. Edit /usr/share/webapps/phpMyAdmin/config.inc.php to add the line:

$cfg['TempDir'] = '/tmp/phpmyadmin';

来源:https://wiki.archlinux.org/index.php/PhpMyAdmin#启用_模板_缓存

这篇关于phpmyadmin 5.1.0.RC1 &amp;5.0.4 错误(./libraries/classes/Config.php#1285 mkdir() 中的警告:权限被拒绝)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆