Ever since Ubuntu upgraded to 16.04 with php 7 setting up LAMP server is not very difficult but getting it up is sometimes troublesome. specially running php7 because running php7 on apache also need to install mbstring and libapache2-mod-php you can use following commands on terminal to install these packages and within in no moment you will have your php working.
Follow the steps below.
To install phpmyadmin use this command and follow onscreen instructions.
sudo apt install php libapache2-mod-phpsudo apt install php7.0-mbstring
Follow the steps below.
- Start the MySQL server with the --skip-grant-tablesoption
 $ mysqld --skip-grant-tables
- Execute these statements.
 $ mysql -u root mysql $mysql> UPDATE user SET Password=PASSWORD('password') where USER='root'; $mysql> FLUSH PRIVILEGES;
update user set authentication_string=password('my_password') where user='root';
- Finally, restart the instance/daemon without the --skip-grant-tablesoption.
 $ /etc/init.d/mysql restart
$ mysql -u root -p
To install phpmyadmin use this command and follow onscreen instructions.
sudo apt install phpmyadmin 
 
you have tried everything on ubuntu 18.04 and php still not working. try following command.
ReplyDeletesudo a2enmod actions
sudo service apache2 restart
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
ReplyDeleteconnect to mysql/mariadb using sudo command that may help..
ReplyDelete