Troubleshooting Apache, PHP 7.0, and MariaDB LAMP, LAMP is an acronym that stands for Linux Apache, MySQL/MariaDB and PHP. I have LAMP installation post for PiHome but i see lots and lots of people are looking for setting up php 7 with phpMyAdmin and MariaDB on raspberry pi and there isn’t any comprehensive set of instruction that covers this all for PHP 7, MariaDB on raspberry pi.

If you are installing LAMP on your Raspberry Pi for PiHome follow OS (Raspbian Jessie) Installation and WiFi Configuration posts to install and get WiFi configured without any screen connected to Raspberry pi.

In this post i will discuss common issues with php 7, MariaDB and phpmyadmin on raspberry pi. Follow this link to Install Apache, PHP 7.0 and MySQL/MariaDB on a Raspberry Pi (LAMP) with phpMyAdmin on Raspberry Pi.

Missing PhpMyAdmin User and Database Tab

phpMyAdmin main screen no “User Tab” and Under “Database Tab” Create Database – “No Privileges ” . What can I do to Get the “User Tab” and Privileges, run following command and follow the on screen steps.

This will fix your issue, You may need to check phpmyadmin.config files as well for MySQL/MariaDB username and password. and make sure you have correct mysql/mariadb credentials.

/etc/dbconfig-common/phpmyadmin.conf

gpg: no valid OpenPGP data found.

If you get Error message for gpg: no valid OpenPGP data found.

Make sure you edit your /etc/apt/sources.list file and it should look like

E: Package ‘mariadb-server’ has no installation candidate E: Unable to locate package mariadb-client

If you get this error message while installing MariaDB, You have to determine which version of raspbian you have installed.

After figuring out which version choose the one for jessie or the one for stretch. Make sure you choose the correct repository for the version of raspbian. (Thanks to Jonathan)

If you are looking for Raspberry pi SD card image for LAMP (Apache, PHP 7.0 and MySQL/MariaDB on a Raspberry Pi with phpMyAdmin) pre installed then check out Download section. 

Reinstall PhpMyAdmin

if you think you made to many mistakes and you need to reinstall phpmyadmin then issue this command.

if above doesn’t work then try

Now install phpmyadmin

PhpMyAdmin – Unable to login as root

If you are unable to login to phpMyAdmin as root credentials then the simplest solution will be create a new user and grant required privileges to this user.

Login to MySQL/MaridaDB

MySQL/MariaDB User for phpMyAdmin

No lets create user for phpmyadmin, Run the following three commands while still logged in to MySQL/MariaDB.

Update phpMyAdmin Config

Edit /etc/dbconfig-common/phpmyadmin.conf file updating username and password values in the following sections.

PhpMyAdmin Errors

if you get Connection for controluser as defined in your configuration failed. then you need to check /etc/phpmyadmin/config-db.php and check all database information are correct i.e dbusername and dbpassword.

if you get “ERROR 1396 (HY000): Operation CREATE USER failed for <username>” then you need to check /etc/dbconfig-common/phpmyadmin.conf and look for dbc_dbuser and dbc_dbpass and make sure these are correct and same as in /etc/phpmyadmin/config-db.php