0

In Windows,i used WAMP and adobe dreamweaver. In Ubuntu,i am planning to use bluefish editor. I hear that WAMP server equivalent is LAMP in ubuntu. I need detailed and simple explaination to install LAMP server in ubuntu. I am a beginner,so make it simple as you can.

7
  • Seriously? Did you even search for this before asking?
    – Parto
    Aug 26, 2015 at 8:47
  • 1
    possible duplicate of What's the easiest way to set up a LAMP stack?
    – Parto
    Aug 26, 2015 at 8:47
  • Hey, I don't mean it in a bad way, just that this question has been asked before. And the policy here is to minimize duplicates as possible. Am sorry if I was a bit harsh but that's just AskUbuntu.
    – Parto
    Aug 26, 2015 at 9:10
  • This command always does it for me sudo apt-get install lamp-server^ phpmyadmin - it will install everything you need for LAMP development.
    – Parto
    Aug 26, 2015 at 9:12
  • No, just leave it here. The MODS will know how to handle it. MODS --> askubuntu.com/users?tab=moderators
    – Parto
    Aug 26, 2015 at 9:19

4 Answers 4

2

1. Installing and setting up the LAMP stack

  1. Open Terminal by hitting Ctrl+Alt+T
  2. Update the apt cache and install lamp-server^ by running sudo apt-get update && sudo apt-get install lamp-server^ (you should be able to go through the on-screen setup; it's just a matter of setting up the mysql root password)

2. Installing and setting up PHPMyAdmin

  1. Open Terminal by hitting Ctrl+Alt+T
  2. Update the apt cache and install phpmyadmin by running sudo apt-get update && sudo apt-get install phpmyadmin (you should be able to go through the on-screen setup; it's just a matter of providing the mysql root password, setting up the phpmyadmin password and choosing which DBMS you want to configure, i.e. mysql)

3. Setting up Apache for PHPMyAdmin

  1. Open Terminal by hitting Ctrl+Alt+T
  2. Add this line (Include /etc/phpmyadmin/apache.conf) to /etc/apache2/apache2.conf by running echo 'Include /etc/phpmyadmin/apache.conf' | sudo tee -a /etc/apache2/apache2.conf
  3. Restart apache by running sudo service apache2 restart

Finally, test Apache and PHPMyAdmin to see if everything went right;

Test Apache by opening http://localhost in your web browser; if everything went right you should see this:

apache

Test PHPMyAdmin by opening http://localhost/phpmyadmin in your web browser; if everything went right you should see this:

phpmyadmin

4
  • @user284923 Do you mind to explain why you switched the acceptance?
    – kos
    Jul 25, 2015 at 9:46
  • @john9983 I just didn't understand why you switched, I tought something went wrong. No you shouldn't need to. Try to put a PHP file containing <?php phpinfo(); ?> in /var/www/html and see if it works.
    – kos
    Jul 25, 2015 at 17:18
  • it works.Can you tell me which is the best php editor in ubuntu?is it bluefish?do i need to switch?
    – john9983
    Jul 25, 2015 at 17:32
  • @john9983 I use gedit, so I'm not really the right person to ask. Sometimes I've had to do some more complex job and I used Notepad++ in WINE, since I loved it on Windows, but I suggest you to try more than one and to just stick to the one that you prefer. Bluefish seems legit tough.
    – kos
    Jul 25, 2015 at 17:35
1

To install these packages in the command-line you can type

sudo apt-get install lamp-server^ phpmyadmin

There is also extensive documentation how to set up a LAMP environment with phpmyadmin at https://help.ubuntu.com/community/ApacheMySQLPHP | https://help.ubuntu.com/14.04/serverguide/lamp-applications.html

Feel free to ask more specific questions if you feel stuck somewhere in the process.

0

Run those commands:

sudo apt-get update

Install apache:

sudo apt-get install apache2

You can test apache2 is working by directing your browser to http://localhost , you should see "it works" output.

Install PHP:

sudo apt-get install php5 libapache2-mod-php5

Restart apache2 now:

sudo service apache2 restart 

To test PHP now create a file testphp.php under the web root directory /var/www

sudo gedit /var/www/testphp.php

Then add this line:

<?php phpinfo(); ?>

Save and close the file, then open you're web browser direct your browser to: http://localhost/testphp.php

you should see a page showing the php information .

Install Mysql:

sudo apt-get install mysql-server

Optional you may need to install a program called phpMyAdmin which is an easy tool to edit your databases.

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
0

You might also want to look at setting up a VirtualBox environment for PHP development. This way you keep your host OS free from server packages but you can still do all development on your own PC with the shared folder functionality. :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .