Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What is the most correct method of installing apache 2 server, php5, mysql and phpMyAdmin?

I installed it this week, and I had a lot problems without solutions, so now that I reinstalled Ubuntu 13.04 I don't want to make the same mistake again.

share|improve this question

4 Answers 4

up vote 6 down vote accepted

From a command line:

sudo apt-get install tasksel
sudo tasksel install lamp-server


share|improve this answer
Another option is sudo apt-get install lamp-server^? –  Sithu Oct 22 '14 at 12:25
I installed lamp-server^. Does it include phpMyAdmin? How can I access it from browser? –  Sithu Oct 22 '14 at 12:57

Install Apache2

sudo apt-get update

sudo apt-get install apache2

sudo apt-get install php mysql-server mysql-client php5-mysql libapache2-mod-auth-mysql php-mbstring php5-gd libapache2-mod-php5

sudo mysql_install_db

Set password for mysql

sudo /usr/bin/mysql_secure_installation

Then install the php

sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl

Then to check the PHP

sudo vim /var/www/info.php


sudo /etc/init.d/apache2 restart

Install phpmyadmin

apt-get install phpmyadmin

While installation it will ask for some settings for choosing apache server or lighthttpd choosem apache

Choose Apache

Choose no for dbconfig-common

Now Navigate to the Web Browser and openup the IP mentioned with /phpmyadmin/

eg :

Use Your Login what u used for mysql installation

Login Information I always use for demo purpose is

root and password is admin123

share|improve this answer
vas@LenovoZ580:~/Desktop$ sudo apt-get install php mysql-server mysql-client php5-mysql libapache2-mod-auth-mysql php-mbstring php5-gd libapache2-mod-php5 Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package php E: Unable to locate package php-mbstring –  L.V.A Oct 15 '13 at 16:12
Remove the php-mbstring and install using other –  Lonston Oct 16 '13 at 5:19

The quickest and my favorite is - open the terminal and type

sudo apt-get install lamp-server^ phpmyadmin
share|improve this answer
problem is solved, but thanks. –  L.V.A Oct 16 '13 at 17:14
@user118136 I just added mine for future readers - did see the solved mark. –  Pieter Oct 17 '13 at 5:06

On Ubuntu 13.10 I had an error installing phpmyadmin:

Errors were encountered while processing: javascript-common

When I loaded the page in my browser it came up as:

error: json missing

Found the answer here: http://superuser.com/questions/639945/how-to-fix-the-phpmyadmin-error-json-extension-is-missing

Just thought I'd help out, I'm very new to all of this, but getting the hang of it, the community is very helpful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.