The $cfg['TempDir'] (/usr/share/phpmyadmin/tmp/) is not accessible. Debian 12

phpmyadmin is giving error:

The $cfg[‘TempDir’] (/usr/share/phpmyadmin/tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

I’ve run all the commands and it didn’t work:

chown -R root:www-data /etc/phpmyadmin/
chown -R hestiamail:www-data /usr/share/phpmyadmin/tmp/

chown -R hestiamail:www-data /usr/share/phpmyadmin/tmp/

It only resolved when I changed the folder permission to 777

/usr/share/phpmyadmin/tmp

Is there a way to solve it without defining 777?

That command should work fine to fix the issue with tmp. Dir perms should be 770.

❯ ls -ld /usr/share/phpmyadmin/tmp
drwxrwx--- 3 hestiamail www-data 4096 jul 20  2023 /usr/share/phpmyadmin/tmp

Could you please show the output of these commands?

ls -la /usr/share/phpmyadmin/tmp/
php -v | head -1
cat /etc/php/$(php -v | head -1 | sed -E 's/.*([0-9]{1,}\.[0-9]{1,})\.[0-9]{1,}.*/\1/')/fpm/pool.d/www.conf

ls -la /usr/share/phpmyadmin/tmp/

root:~# ls -la /usr/share/phpmyadmin/tmp/
total 12
drwxrwx— 3 hestiamail www-data 4096 Jun 20 19:33 .
drwxr-xr-x 13 root root 4096 Jun 20 19:10 …
drwxr-x— 27 hestiamail www-data 4096 Jun 20 19:33 twig

php -v | head -1

PHP 8.2.20 (cli) (built: Jun 8 2024 21:32:49) (NTS)

cat /etc/php/$(php -v | head -1 | sed -E ‘s/.([0-9]{1,}.[0-9]{1,}).[0-9]{1,}./\1/’)/fpm/pool.d/www.conf

cat: /etc/php/8.2/fpm/pool.d/www.conf: No such file or directory
I use apache2

You should have a www.conf in that dir, doesn’t matter whether you use nginx or nginx+apache2.

Show the output of this command:

find /etc/php -name www.conf

Nothing returned.

Then you have a problem.

Show the output of these commands:

apache2ctl -M | grep -E 'php|mpm'
ls -l /etc/apache2/conf.d/
curl -sSL https://7j.gg/hcpver | bash -s --
root:~# apache2ctl -M | grep -E 'php|mpm'
 mpm_itk_module (shared)
 mpm_prefork_module (shared)
 php_module (shared)

root:~# ls -l /etc/apache2/conf.d/
total 12
-rw-r--r-- 1 root root  542 Jun 20 19:10 154.38.184.94.conf
drwxr-xr-x 2 root root 4096 Jun 21 08:07 domains
-rw-r--r-- 1 root root  980 Jun 20 19:10 phpmyadmin.inc

root:~# curl -sSL https://7j.gg/hcpver | bash -s --
Software          Version
--------          -------
OS            Debian 12.5
Hestia             1.8.11
Hestia-nginx       1.25.2
Hestia-php         8.2.11
Nginx              1.27.0
Apache2            2.4.59
Awstats               7.8
Vsftpd              3.0.3
Bind9             9.18.24
Mariadb           10.11.6
Fail2ban            1.0.2

Apache2 should be using mpm_event instead of mpm_prefork, also, it shouldn’t use php_module.

Did you reinstall apache2?

You should do a few things to fix it but I don’t want to screw your system…

Installation was done with the script:

bash hst-install.sh --lang pt-br --phpfpm no --exim no --dovecot no --spamassassin no --api no

I didn’t change anything.

Hestia has been updated from an old version or did you install 1.8.x?

I installed it yesterday for the first time.

And apache was installed before installing Hestia?

I don’t remember. Do you recommend reinstallation? If so. What is the sequence?

Yes, I recommend reinstallation.

Install a new and minimal Debian 12 image in your server, update it, don’t install any new package and then install Hestia.

Double check whether Apache is included (it shouldn’t) in the Debian image provided by your hosting company.

But then will I need to install PHP-FPM on hestia cp?

Reading that question… did you add this option --phpfpm no when installing Hestia? That would explain the reason you are not using mpm_event.

If the answer is yes, is there any reason for you to use that option during install?

I didn’t install PHP-FPM, as I need to use Apache. Does installing PHP-FPM make it better?

You can use Apache and php-fpm, indeed is the default conf is you add no option to installer, I mean, --phpfpm yes is the default if you don’t use --phpfpm no

I reinstalled Debian 12. Error still appears in phpMyAdmin

ls -la /usr/share/phpmyadmin/tmp/

root:/tmp# ls -ld /usr/share/phpmyadmin/tmp
drwxrwx— 2 root hestiamail 4096 Jun 21 10:53 /usr/share/phpmyadmin/tmp
root:/tmp# systemctl restart apache2
root:/tmp# systemctl restart mariadb
root:/tmp# ls -la /usr/share/phpmyadmin/tmp/
total 8
drwxrwx— 2 root hestiamail 4096 Jun 21 10:53 .
drwxr-xr-x 13 root root 4096 Jun 21 10:53 …

php -v | head -1

root:/tmp# php -v | head -1
PHP 8.2.20 (cli) (built: Jun 8 2024 21:32:49) (NTS)

Erros:
The $cfg[‘TempDir’] (/usr/share/phpmyadmin/tmp/) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.

The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated. [Find out why]
Or alternately go to ‘Operations’ tab of any database to set it up there.