Error in phpMyAdmin after updating to v4.8.0: The $cfg['TempDir'] (./tmp/) is not accessible

Solution was to create a folder called tmp like this: /usr/share/phpmyadmin/tmp.

Also make sure that the user (or group) running the webserver (e.g. Apache) has write access to the newly created tmp folder. Consequently, change the ownership to that user or add write access for all users. The latter one might not be really advisable.


simple fix is to create tmp dir in your phpmyadmin dir and set permission to 777

mkdir tmp && chmod 777 tmp

then

update your config.inc.php file add that line

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

I had this same problem on Ubuntu 18.04 when I replaced the phpMyAdmin version from the package repository (v4.6.6) with the latest version (4.8.0). I don't know if you are running on Ubuntu, but maybe my response will be helpful to you (or others) who encounter something similar.

I put the new version in the standard location, /usr/share/phpmyadmin/, but Ubuntu's package installation of PMA puts some configuration settings in other places (see /etc/phpmyadmin/ and /var/lib/phpmyadmin/). I found this setting in /etc/phpmyadmin/apache.conf:

php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp

and sure enough that directory had been created and had the proper permissions. Wanting to stay as close as possible to the package installation settings, I made this change in /usr/share/phpmyadmin/libraries/vendor_config.php and pointed directly to that folder:

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

This setting is picked up by /usr/share/phpmyadmin/libraries/config.default.php (which you are not supposed to edit) to set $cfg['TempDir'].