Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 views
in Technique[技术] by (71.8m points)

Phpmyadmin 5.1.0.RC1 & 5.0.4 error (Warning in ./libraries/classes/Config.php#1285 mkdir(): Permission denied)

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: PhpMyAdminConfig->getTempDir(string 'twig')
./libraries/classes/Theme.php#101: PhpMyAdminTemplate->__construct()
./libraries/classes/Theme.php#174: PhpMyAdminTheme->__construct()
./libraries/classes/ThemeManager.php#307: PhpMyAdminTheme::load(
string './themes/pmahomme',
string '/usr/share/phpmyadmin/./themes/pmahomme/',
)
./libraries/classes/ThemeManager.php#79: PhpMyAdminThemeManager->loadThemes()
./libraries/classes/ThemeManager.php#121: PhpMyAdminThemeManager->__construct()
./libraries/classes/ThemeManager.php#385: PhpMyAdminThemeManager::getInstance()
./libraries/common.inc.php#232: PhpMyAdminThemeManager::initializeTheme()
./index.php#15: require_once(./libraries/common.inc.php)

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.

my vendor config is :

<?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);

and i work with php8.0.

Thx for your backs !

question from:https://stackoverflow.com/questions/65641099/phpmyadmin-5-1-0-rc1-5-0-4-error-warning-in-libraries-classes-config-php12

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Had same issue solved it by: Open vendor_config.php

sudo nano /usr/share/phpmyadmin/libraries/vendor_config.php

Press CTRL + W and search for TEMP_DIR

Change line to

define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');

Press CTRL + W and search for CONFIG_DIR

Change line to

define('CONFIG_DIR', '/etc/phpmyadmin/');

Save file and exit. (Press CTRL + X, press Y and then press ENTER)

Select the installed version https://www.phpmyadmin.net/files/

extract and replace the /libraries/classes/Config.php file with existing one.

Thanks & Regards.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...