phpMyAdmin acting crazy

Hello all, I’m getting (again) the error message: The configuration file needs a valid key for cookie encryption. A temporary key was automatically generated for you. Please refer to the [documentation]. I checked and the temp key is THERE.

Also, I’m getting an old error: A $cfg[‘TempDir’] (/usr/share/phpmyadmin/tmp/ 1) não se encontra acessível. Directory not accessible, easily fixed by chown… but not working! Someone please help. Ty.

Hi @HugoASB,

Show the output of these commands:

dpkg -l | grep phpmyadmin
grep blowfish /etc/phpmyadmin/config.inc.php | sed -E 's/(^.*=\s\".{1,8}).*(\".*$)/\1[REMOVED]\2/'
ls -la /usr/share/phpmyadmin/tmp/

It’s ok if the first dpkg command returns nothing (it’s the expected output).

1 Like
root@master:~# dpkg -l | grep phpmyadmin
root@master:~# grep blowfish /etc/phpmyadmin/config.inc.php | sed -E 's/(^.*=\s\".{1,8}).*(\".*$)/\1[REMOVED]\2/'
$cfg["blowfish_secret"] = "6Q4iCvDR[REMOVED]"; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
root@master:~# ls -la /usr/share/phpmyadmin/tmp/
total 12
drwxr-xr-x  3 hestiamail www-data 4096 Jun 22 23:32 .
drwxr-xr-x 13 root       root     4096 Jun 22 19:43 ..
drwxr-x--- 57 hestiamail www-data 4096 Jun 23 02:19 twig

Change the dir perms and try again:

chmod 770 /usr/share/phpmyadmin/tmp/
root@master:~# chmod 770 /usr/share/phpmyadmin/tmp/
root@master:~# dpkg -l | grep phpmyadmin
root@master:~# grep blowfish /etc/phpmyadmin/config.inc.php | sed -E 's/(^.*=\s\".{1,8}).*(\".*$)/\1[REMOVED]\2/'
$cfg["blowfish_secret"] = "6Q4iCvDR[REMOVED]"; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
root@master:~# ls -la /usr/share/phpmyadmin/tmp/
total 12
drwxrwx---  3 hestiamail www-data 4096 Jun 22 23:32 .
drwxr-xr-x 13 root       root     4096 Jun 22 19:43 ..
drwxr-x--- 57 hestiamail www-data 4096 Jun 23 02:19 twig

I meant, try again to check if you see the same error when using phpmyadmin.

Are you using Nginx or Nginx+Apache?

Show the output of these commands:

lsof -Pn +c0 -iTCP:9000 -sTCP:LISTEN
for i in $(grep -rl 9000 /etc/php/);do echo "Checking $i:"; cat "$i";echo;done
root@master:~# lsof -Pn +c0 -iTCP:9000 -sTCP:LISTEN
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
php-fpm8.2 511 root    9u  IPv4  18941      0t0  TCP 127.0.0.1:9000 (LISTEN)
root@master:~# for i in $(grep -rl 9000 /etc/php/);do echo "Checking $i:"; cat "$i";echo;done
Checking /etc/php/8.2/fpm/pool.d/www.conf:
; origin-src: deb/php-fpm/www.conf

[www]
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1

;"hestiamail" user created to prevent users from abusing this config
user = hestiamail
group = www-data

pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 10s

The outputs are the right ones.

Show this:

apache2ctl -M | grep -E 'php|mpm'
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using master.hugoasb.com. Set the 'ServerName' directive globally to suppress this message
 mpm_prefork_module (shared)
 php_module (shared)

Ok, now the question is, why are you using php module and mpm prefork in Apache instead of mpm event and php fpm?

I’m running HestiaCP out of the box. How can I check that?

Did you use this option --phpfpm no when installing Hestia? That would explain the use of mpm prefork and php module in Apache.

Don’t believe I did.

Then maybe you installed some php packages manually…?

Options:

1.- Change the owner of the dir:

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

Check phpmyadmin to see whether it works with no issues.

2.- Take a look to this post:

Seems there is a bit mess in your system.

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

And take a look to option 2 or reinstall Hestia.

I messed around with the PHP modules trying to fix another issue.

I’m gonna go ahead with a clean reinstall, thank you for your patience!

1 Like