Hi I am having trouble with phpmyadmin.
It is basicly a fresh installed version. I cannot figure out why this does not work. I did not modify any of the files yet.
It show following error messages when logged in:
The configuration file now needs a secret passphrase (blowfish_secret).
The $cfg['TempDir'] (/var/lib/phpmyadmin/tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.
stat /var/lib/phpmyadmin/tmp
File: /var/lib/phpmyadmin/tmp
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 803h/2051d Inode: 170769 Links: 3
Access: (0777/drwxrwxrwx) Uid: ( 33/www-data) Gid: ( 33/www-data)
Access: 2020-09-07 02:26:51.239765744 +0200
Modify: 2020-06-26 03:45:53.392552054 +0200
Change: 2020-09-07 02:34:01.222889412 +0200
Birth: -
As mentioned above I did not modify blowfish secret or any other files
ls /var/lib/phpmyadmin/
blowfish_secret.inc.php tmp
Also the configuration file looks correct. I even tried to change the path a little bit to see if it has any effect and is the correct configuration file. It shows the same error but with the new path.
sudo nano /usr/share/phpmyadmin/libraries/vendor_config.php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* File for vendor customisation, 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.
*
* @package PhpMyAdmin
*/
if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Path to vendor autoload file. Useful when you want to
* have have vendor dependencies somewhere else.
*/
define('AUTOLOAD_FILE', './autoload.php');
/**
* Directory where cache files are stored.
*/
define('TEMP_DIR', '/var/lib/phpmyadmin/tmp/');
/**
* Path to changelog file, can be gzip compressed. Useful when you want to
* have documentation somewhere else, eg. /usr/share/doc.
*/
define('CHANGELOG_FILE', '/usr/share/doc/phpmyadmin/changelog.gz');
/**
* Path to license file. Useful when you want to have documentation somewhere
* else, eg. /usr/share/doc.
*/
define('LICENSE_FILE', '/usr/share/doc/phpmyadmin/copyright');
/**
* Directory where SQL scripts to create/upgrade configuration storage reside.
*/
define('SQL_DIR', './sql/');
/**
* 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');
/**
4
Answers
Looking at the code, I see that the message appears about
tmp
directory when phpmyadmin cannot accesstwig
temp directory. This means that/var/lib/phpmyadmin/tmp/
may be accessible but/var/lib/phpmyadmin/tmp/twig
may not (e.g. wrong permissions or missing).It could also be that
twig
temp directory is not under/var/lib/phpmyadmin/tmp/
because to access it they use:$this->config->getTempDir('twig')
, but to report the error abouttmp
dir path they use:$this->config->get('TempDir')
.See below:
TLDR: The message is probably misleading. You should check whether twig cache directory is accessible (ownership/permissions).
Could you please check permission of directory /var/lib/phpmyadmin. tmp seems correct permissions.
above directory should be 755 permission atleast or ownership of same user which is using for webserver as well.
and check if selinux enabled by below command
I ran in to this issue setting up PhpMyAdmin Version 5.1.0 on a LEMP stack. Distribution is Fedora 33 and all software is using the default repositories.
I have found the installation defaults vary heavily between distributions, and had some trouble getting it setup for my particular arrangement. Largely, this was due to conflicting information I found during troubleshooting.
I say this because the real solution for the problem depends on setting the proper directory owner and path based on your installation.
In my installation, the
$PMA-DIR/config.inc.php
has the working directories existing in/var/lib/phpMyAdmin/
.So the error I received logging in read:
The $cfg['TempDir'] (/var/lib/phpMyAdmin/temp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.
So I checked the details for the main PMA directory there:
ls -l /var/lib/phpMyAdmin
Which resulted in:
If I was using
httpd
for the webserver this would have been fine. However, I am running nginx so I needed to change ownership, respectively:chown -R nginx:nginx /var/lib/phpMyAdmin
And now I can see that
ls -l /var/lib/phpMyAdmin/
shows:And just to be sure that
phpMyAdmin
and I were really talking about the same directory, I edited my$PMA-DIR/config.inc.php
and modified the relevant section to look like this:After reloading
nginx
and refreshing, the error is gone for me.For your use case it may very well be that you have a different user than what is required.
I have seen many guides that have listed the user as
www-data
, but in some cases, the user isnobody
/apache
/httpd
.To find the proper one you could run something like
ps aux | egrep '(apache|apache2|httpd|nginx)'
.The first field in the results should be the right owner.
Apply it to the correct path with
chown
as demonstrated above.If you set the rest of your configuration already and are still having the Blowfish setting error after this; then you may have a separate folder for the main configuration that will need ownership changed, as well.
For me it was due to the Fedora install using
/etc/phpMyAdmin
directory as the main config directory.It was owned by
apache
. After setting it tonginx
, the blowfish error was also gone.TL;DR: Solved on Fedora 33 with LEMP(Nginx) by using:
chown -R nginx:nginx /var/lib/phpMyAdmin
and
chown -R nginx:nginx /etc/phpMyAdmin
Let’s assume what are causes for this messge.
This are so far I faced when configuring phpmyadmin application.
Now how to solve this:
mkdir -p /var/lib/phpmyadmin/tmp/twig
cd /var/lib
sudo chmod -R 775 phpmyadmin/
this set read and write file permission.
/etc/apache2/envvars
file. look for values of APACHE_RUN_USER, APACHE_RUN_GROUPcd /var/lib
sudo chown -R APACHE_RUN_USER_VALUE:APACHE_RUN_GROUP_VALUE phpmyadmin/