How to install LAMP and PhpMyadmin on LinuxMint 7 Gloria

linuxmint-logoLAMP (Linux, Apache, MySQL and PHP) is an open source Web development platform that uses Linux as operating system, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language.
In this Simple tutorial we will explain you how to install LAMP server on your LinuxMint7 Gloria
The installation will be done in 3 steps:
Apache, PHP and MySQL, after that we will install phpmyadmin the administration software tool for MySql.

1- Apache2 installation

sudo apt-get install apache2  

to check that Apache has been installed without problems, go to your browser and type


if everything is correct you will see the message :

It works

Now we will go and try to install PHP5

2- PHP5 and dependencies installation:

sudo apt-get install php5 libapache2-mod-php5 

A restart of apache2 is needed to make this one see PHP5, to restart apache2 use the command:

sudo /etc/init.d/apache2 restart

3- MySql Installation :

To install MySql type the command

sudo apt-get install mysql-server  

During the installation you will got this screen (package configuration) to set root password for MySql, enter your password and retype it

if you diden`t got the screen to setup root password for mysql then you have to do it manually, to setup root password for mysql :

mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('YOURPASSWORD');   

Don`t forget to change YOURPASSWORD with the password you want to use The basic installation of LAMP is ready. Now we will install phpmyadmin,

phpMyAdmin is a free graphical software tool to handle the administration of MySQL, this will make it easy for you to create, import/export and delete

databases. Install phpmyadmin using the command:


sudo apt-get install phpmyadmin  

During the installation a blue screen will appear asking you which server you want to use apache, apache2 …. choose then apache2 and click ok

Then you will be asked to set a password for your phpmyadmin

 Type the password and retype it

Now  is done, Point your browser to: http://domain/phpmyadmin you will got this screen


if you diden`t receive any screen of psckage configuration during the installation of phpmyadmin then you will have

To set up phpmyadmin under Apache manually, all you need to do is include the following line in /etc/apache2/apache2.conf, first type the following command to open up this file:

sudo gedit /etc/apache2/apache2.conf

Add the following line of code inside apache2.conf:

Include /etc/phpmyadmin/apache.conf

Now restart Apache:

sudo /etc/init.d/apache2 restart

and is done, now Point your browser to: http://domain/phpmyadmin (see pic above)

If you have any problem please report it .Thanks.

  • craig b

    Tks for the post, great info, very easy to follow.

    I have a small home network, a XP laptop, a desktop with linux mint 7 and I’ve added an old desktop (running Linux Mint 7) on which I’ve added LAMP, how can I get the other computers to access the LAMP install through their browsers.


  • pirat9

    to access LAMP from other machine :
    For example the Linux ip is
    from other PC:
    to acces you phpmyadmin page

  • aFriend

    Thank you very much for your Help!

    You are good!

  • dixon

    What about tasksel? It’s much easier with tasksel. Just type sudo tasksel and select LAMP to be installed and there you go :)

  • walterav


    I tried your ‘howto’ on linux mint 7 in vmware, but I as soon as selected apach2 in the phpyadmin setup, I get another screen asking “configure phpmyadmin with dbconfig-commen” If I do no, the installation finished but than it doesn’t work.
    If I do yes, I can choose a password but than it gives an error when going on.

    “error 1045:28000” access denied for user root@localhost.

    My server is running at is that the problem?

  • pirat9

    Your mysql-serer is not yet configured.

    mysql -u root -p
    and try if you can login

  • walterav

    Thanks for the quick reply, the mysql server was running, but during the setup I just didn’t understand why I need to enter the password 3 times!

    1 is for the mysql database already configured one step before, and the other 2 are new passwords for the myphpadmin interface…

    I just typed the wrong password therefor it wasn’t able to connect to the mysql server.

    BtW I noticed that allot of these servers are running as root, can I change that easily, because its not safe for a commercial environment…

    any links?

  • mrfedex

    :D Awesome tutorial, exactly what I was looking for.

  • urio

    help me to configure phpmyadmin i try but fail in all two alternative

  • zinovsky

    Ok, try to install phpmyadmin from the package manager and see if it work :)

  • Pradna

    thanks for tutorial, but on me is : “404 Not Found”
    i think phpmyadmin is correctly install on my laptop and apache (localhost) is works.


  • Pradna

    beg me pardon,
    i not read carefully this tutorial (in this section :sudo gedit /etc/apache2/apache2.conf)(worship)…
    and now phpmyadmin is work :D


  • Rob

    Just setting up my first linux install.
    This worked great thanks :D

  • fennilyn

    At the last part, I typed this:
    sudo gedit /etc/apache2/apache2.conf

    But i got this error
    sudo: gedit: command not found

    Why? Please help :cry:

  • fennilyn

    Ooopss. Sorry, I forgot to change the domain word with my IP address. Its working fine…. :oops:

  • df

    Where do I save my PHP files?

  • Jon

    Excellent work mate. :)

  • Artur

    Thanks, Just installed on Mint 9. Worked great.

  • http://none fraser

    I get an error message “# 1045 cannot log in to the mysql server”


  • linux novice

    Thank you for this install guide for LAMP. You do a very good job of outlining all the commands.


  • Trin Calway

    Hi – quick fix for an issue I had …

    If you get:

    [code]* Restarting web server apache2 apache2: Could not reliably determine the server’s fully qualified domain name, using for ServerName
    … waiting apache2: Could not reliably determine the server’s fully qualified domain name, using for ServerName[/code]

    To fix that problem, you need to edit the httpd.conf file. Open the terminal and type,

    [code]sudo gedit /etc/apache2/httpd.conf[/code]

    By default httpd.conf file will be blank. Now, simply add the following line to the file.

    [code]ServerName localhost[/code]

    Save the file and exit from gEdit.

    Finally restart the server.

    [code]sudo /etc/init.d/apache2 restart[/code]

    This fix is from [url=]here[/url]

    He has some other good tips for LAMP/Python.

  • Zinovsky

    Thanks for the tip:)

  • Trin Calway

    Thank you for the walk through! One of the best things about Linux is knowing that someone will have taken their time to help others learn.

  • Ramshini

    Thank you very much!

  • John K Njue

    [b]As simple as ABC. Just a big thankyou.

    It worked on my mepis 8.5 very well.[/b]


  • Mike Eller

    I followed the instructions in the tutorial and all worked except I cannot connect to the database. In php, I use mysql_connect function…and it is not recognized. Evidently, did not get loaded. How do I fix this? Using Linux Mint 10.

  • pirat9

    Mike ELLER
    install this php5-mysqli
    sudo gedit /etc/php5/apache2/php.ini
    If you have this line:


    uncomment it.

  • http://enteryoursiteURL... Mukul Kumar

    thanks it was a great help for me … new to linux … learning

  • CMD

    sudo tasksel

    then select ‘LAMP Server’


  • jean-Marc MILHAUD

    Excellent, very easy!!! Thanks

  • http://enteryoursiteURL... rubul

    what should be the username at php my admin???///

  • http://enteryoursiteURL... Mohammed

    When you installed MySQL, you should have been prompted for a root user password. You can log into PHPMyAdmin with the user `root` and whatever password you chose when setting up MySQL.

  • 123

    try "phpmyadmin" and the password you’ve chosen

  • Paul Appelbaum

    Excellent instructions. Just let people know to login to phpmyadmin username is: root

  • joomlaoscommerce

    i still could not find phpmyadmin in my localhost, even i could not create or past any thing in my www folder, please help me

  • JeniferGrant19

    Set your own life time more easy get the business loans and all you need.

  • Shobarbazar, bd bazar, banglad

    i am using linux mint 10, i see some day the monitor pawer 10 minutes later go way also my pc being hang, but i do not understand any or i could not guess any cause.
    any body linux expert can please help me?


  • Marcus Romer

    Brilliant, worked first time. Just a thought, when logging into PHPMYADMIN I found that the username (for me) is admin.

    Many Thanks

    Marcus Romer

  • Tesema

    Thank you very much! The guide you wrote works like a charm. Tesema

  • Gdawg65

    Followed all directions to access phpadmin page. Get  ‘Server Not Found’. I’m using Mint 11 LXDE. I even followed directions for manually configuring php in apache2 with same result.
    Linux gdawg-Inspiron-530s 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

  • Gdawg65

    My posted problem is solved. Now when I enter user name and password I get “#1045 Cannot log in to the MySQL server”. Now what am I missing here? Thanks. I solved original problem by replacing ‘domain’ with ‘localhost’ and entering it manually instead of using link.

  • Saran3589

    Thank u very much….

  • Bube

    Your wonderful

  • Gaetano

    Works like a charm – very well done

  • Mark Prentice

    Yes this works thanks a lot phpmyadmin is great