Linux ~ phpmyadmin error on PHP 8

Back up phpMyAdmin

Backup dulu file yang lama.

 $ sudo mv /usr/share/phpmyadmin/ /usr/share/phpmyadmin.bak

Create a new phpMyAdmin folder

$ sudo mkdir /usr/share/phpmyadmin/

Change to the directory

$ cd /usr/share/phpmyadmin/

Download and Extract phpMyAdmin

$ sudo wget https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz

Now extract

$ sudo tar xzf phpMyAdmin-*-all-languages.tar.gz

Once extracted, list folder

$ ls

Nanti akan kelihatan folder phpMyAdmin-*-all-languages

Kita akan memindah isi folder ke /usr/share/phpmyadmin

$ sudo mv phpMyAdmin-*-all-languages/* /usr/share/phpmyadmin

Make a copy of /usr/share/phpmyadmin/config.sample.inc.php

$ sudo cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

Now edit the config.inc.php

$ sudo nano config.inc.php

$cfg['blowfish_secret'] = 'Zbwen/BEAFv:HTbqOROrqakJ;KUMIpV:'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

$ Ctrl+x /* to save the file */

Go to your site/phpmyadmin check all error is cleared.

=================================================

YOU MAY ENCOUNTER THIS ERROR MESSAGE ON PHPMYADMIN /INDEX.PHP

IT MAY SAY SOMETHING LIKE:

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

===SOLUTION==

$ sudo mkdir -p /var/tmp/phpMyAdmin

$ sudo chown www-data:www-data /var/tmp/phpMyAdmin

$ sudo chmod -R 700 /var/tmp/phpMyAdmin

Edit the config.inc.php again

$ sudo nano config.inc.php

add or replace this line

$cfg['TempDir'] = '/var/tmp/phpMyAdmin';

Cleanup — You can now delete the tar.gz file and the empty folder.

$ sudo rm -rf /usr/share/phpmyadmin/phpMyAdmin-latest-all-languages.tar.gz

And if you’re certain your new phpMyAdmin install is working correctly you can delete the backup folder.

$ sudo rm -rf /usr/share/phpmyadmin.bak

Leave a Reply

Your email address will not be published. Required fields are marked *