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.
-
Seriously? Did you even search for this before asking? – Parto Aug 26 '15 at 08:47
-
1possible duplicate of [What's the easiest way to set up a LAMP stack?](http://askubuntu.com/questions/34/whats-the-easiest-way-to-set-up-a-lamp-stack) – Parto Aug 26 '15 at 08: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 '15 at 09: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 '15 at 09:12
-
No, just leave it here. The MODS will know how to handle it. MODS --> http://askubuntu.com/users?tab=moderators – Parto Aug 26 '15 at 09:19
-
I assume so, my phpmyadmin just loads automatically. But in case it doesn't, you can always search around. – Parto Aug 26 '15 at 09:31
-
Okay, you have convinced me ---> my -1 to a +1. – Parto Aug 26 '15 at 09:32
4 Answers
1. Installing and setting up the LAMP stack
- Open Terminal by hitting Ctrl+Alt+T
- Update the
aptcache and installlamp-server^by runningsudo 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 themysqlroot password)
2. Installing and setting up PHPMyAdmin
- Open Terminal by hitting Ctrl+Alt+T
- Update the
aptcache and installphpmyadminby runningsudo 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 themysqlroot password, setting up thephpmyadminpassword and choosing which DBMS you want to configure, i.e.mysql)
3. Setting up Apache for PHPMyAdmin
- Open Terminal by hitting Ctrl+Alt+T
- Add this line (
Include /etc/phpmyadmin/apache.conf) to/etc/apache2/apache2.confby runningecho 'Include /etc/phpmyadmin/apache.conf' | sudo tee -a /etc/apache2/apache2.conf - Restart
apacheby runningsudo 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:
Test PHPMyAdmin by opening http://localhost/phpmyadmin in your web browser; if everything went right you should see this:
-
-
@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 `` in `/var/www/html` and see if it works. – kos Jul 25 '15 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 '15 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 '15 at 17:35
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.
- 576
- 3
- 11
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
- 82,867
- 54
- 239
- 271
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. :)
- 2,726
- 3
- 20
- 42

