Installing LAMP on Ubuntu 7.10/8.04/8.10 (Linux,Apache,MySQL,PHP)

on Monday, November 5th, 2007 at 1:33 am

Lately I’ve been using ubuntu 7.10 for all my projects/daily work.
As a web developer i should have LAMP on my machine and now i would guide you through installing it on yours.

This guide is divided into 3 steps: installing/tesing Apache, PHP and finally MySQL.

Lets start with Apache:
1. Open the terminal (we will be using it through most of my guide) from Applications > Accessories > Terminal
2. Install apache2 using apt-get by typing the following

sudo apt-get install apache2

Note that you should know the root password.
Now everything should be downloaded and installed automatically.
To start/stop apache2 write:

sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop

Your www folder should be in: /var/www/

If everything is OK you should see an ordinary HTML page when you type: http://localhost in your firefox browser

Finished with Apache ? lets conquer PHP:
1. Also in terminal write:

sudo apt-get install php5 libapache2-mod-php5

or any php version you like
2. restart apache

sudo /etc/init.d/apache2 restart

This is it for PHP :D
Wanna test it ? Just create an ordinary PHP page in /var/www/ and run it.
Example:

sudo gedit /var/www/test.php

and write in it: < ?php echo “Hello World”; ?>

Now run it by typing http://localhost/test.php in firefox… You should see your ” Hello World ”
66 % is over, lets continue to installing MySQL:
1. Again and again in terminal execute:

sudo apt-get install mysql-server

2. (optional) If you are running a server you should probably bind your address by editing bind-address in /etc/mysql/my.cnf and replacing its value (127.0.0.1) by your IP address

3. set your root password (although mysql should ask you about that when installing)

mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘xxxxxx’);

4. Try running it

mysql -uroot -pxxx

where xxx is your password.
Note: You can install PHPMyAdmin for a graphical user interface of MySQL by executing

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

5. restart apache for the last time

sudo /etc/init.d/apache2 restart

Congratulions your LAMP system is installed and running :D
Happy Coding

//Jo

UPDATE:
Due to the large number of people emailing about installing/running phpmyadmin.
Do the following:

sudo apt-get install phpmyadmin

The phpmyadmin configuration file will be installed in: /etc/phpmyadmin
Now you will have to edit the apache config file by typing

sudo vi /etc/apache2/apache2.conf

and include the following line:

Include /etc/phpmyadmin/apache.conf

Restart Apache

sudo /etc/init.d/apache2 restart

Another issue was making mysql run with php5
First install these packages:

sudo apt-get install php5-mysql mysql-client

then edit php.ini and add to it this line : ” extensions=mysql.so” if it isnt already there

sudo vi /etc/php5/apache2/php.ini

Restart Apache

sudo /etc/init.d/apache2 restart

Hope this helps :)

164 Comments »

Why dont you use the package provided from apachefriends.org? It’s done with 3 easy steps:

1. Download
2. Untar/Unzip
3. Start the script

I am using it and I can say that for development machine it’s prefect – saves a lot of effort and everything is in one folder.

Comment by Nik Chankov | November 6, 2007 @ 10:05 am

Using APT (apt-get) the Apache, MySQL and PHP software installations will be updated from the Ubuntu repositories when new code is available. So that means bugfixes and security patches will get made available for download automatically. The OS handles this for you. I’m not sure you get that same functionality using the ‘apachefriends version’.

Coming from a Windows world it takes a little time to get used to the APT thinking of things, especially the fact that software is installed ‘all over the file directory structure’ and not in one particular user defined directory… I guess there are pros and cons with both.

Comment by Lee Francis Wilhelmsen | November 6, 2007 @ 2:59 pm

You are completely right Lee, actually thats the exact purpose of apt-get

Comment by Jo | November 6, 2007 @ 3:10 pm

[...] Installing LAMP on Ubuntu 7.10 (Linux,Apache,MySQL,PHP) at FARAWAY (tags: lamp linux ubuntu guide howto tutorial install installation apache php mysql) [...]

Please please please tell me how two things…

1) How do I stop and start apache?
2) And do I open phpmyadmin?

I am new to linux and could really use the help… thanks.

Comment by Bardic | November 7, 2007 @ 5:06 am

Fantastic, straightforward at to the point. Just what I was looking for :-) I also tried the LAMPP package, but I prefer to let apt take care of things. Besides, its actually easier to find things with a standard install as all other product install guides refer to locations used by this type of setup.

Comment by JimmyB | November 7, 2007 @ 8:59 am

Bardic: to stop and start apache write
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start

to do a restart
sudo /etc/init.d/apache2 restart

Comment by Jo | November 7, 2007 @ 11:30 am

this is perfect guide for newbies to linux, it’s written perfectly easy and understandable. I used this to install so called LAMP server on my machine and it workes perfect :)

Big thanks to Jo :)

(i’m sorry for any mistakes in my english)

Comment by qwerti | November 7, 2007 @ 11:27 pm

Excellent guide!

I have two additions:

When apt-get shows the error message “couldn’t find package phpmyadmin” you need to enable the universe repositories in “/etc/apt/sources.list”.

And MySQL did not ask me for a password, it told me:

* Root password is blank. To change it use:
* /etc/init.d/mysql reset-password

To change the password using your method you first need
to start the mysql interface using the following command:

$ mysql -uroot

After that you can change your password with:

mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(‘xxxxxx’);

After that you need to specify your password using -pxxxxxx

Thanks for your guide!

Comment by Des | November 8, 2007 @ 12:34 am

Nice Des, Thank you for sharing

Comment by Jo | November 8, 2007 @ 12:30 pm

Hey Jo,

Thanks for writing this guide, I’s been very useful! I Tried the Apachefriends.org version – It didn’t work. Whereas this, has worked a treat! *Bookmarks Website*

Thanks again,

Joe

Comment by Joe Redfern | November 8, 2007 @ 9:27 pm

Hi Jo,

Great tutorial thanks! It works a charm! Another cool thing you can do when testing whether PHP is properly installed is to create a phpinfo.php file with the following line in it:

It will then give you a whole raft of details on your PHP install when you go to http://localhost/phpinfo.php and it’s also a good file to drop somewhere on your web site to check what your ISP supports.

Bardic, to get to phpmyadmin, type http://localhost/phpmyadmin in your browser: as simple as that!

Comment by Bruno | November 11, 2007 @ 12:26 am

I got caught by the filtering of angle brackets and stuff so the phpinfo.php file mentioned in my previous post should contain:

<?php phpinfo(); ?>

Comment by Bruno | November 11, 2007 @ 12:31 am

thanx for the mysql tip bro
i couldn’t remember the name of the package for the love of god

Comment by eXodus | November 12, 2007 @ 2:09 am

I’ve been an Ubuntu user for about 36 hours. Using your article, I was able to install and test a web server, PHP, MySQL and PHPmyAdmin in under 15 minutes. I have yet to do the same in a Windows server in under 3 hours, and that is if all goes well. Incredible article and incredible OS.

Comment by BrianH | November 14, 2007 @ 6:09 am

Everything works great until I try to install the PHP stuff. After running for 8 hours repeatedley trying to load the following:
Get:135 http://sg.archive.ubuntu.com gutsy/main libapache2-mod-php5 5.2.3-1ubuntu6 [2542kB]
Seems to be stuck trying to load from sg.archive.ubuntu.com ?
I am in Singapore, is there a way I can force it to load from another repository, since Singapore seems unresponsive (I gather that is the 135th attempt to download, since he same message has been repeated constantly with the only thing changing being the number at the front.

Comment by Greg Parsons | November 14, 2007 @ 1:36 pm

Fantastic, just what I needed, thanks Jo.

One tiny thing I noticed. I was feeling lazy so I was just copying and pasting everything you put. When i tried testing PHP with the ‘Hello world’ example you gave, it didn’t appear to be working. I soon realised it was because there is a space after the opening bracket and before the question mark (“< ?” instead of “<?”)!!!! Simple thing but not sure if it would throw some people!

Thanks again.

Comment by Rake | November 17, 2007 @ 12:49 am

Jo… Thanks very much for the very clear steps on getting the Ubuntu LAMP turned on! Only thing I would suggest is remove the space between the “< ?” in the “”. The space will trip up php, and show the code as plain text on the web page.

Thanks to Des too for his tip!

Comment by Fish Kungfu | November 17, 2007 @ 7:38 am

HEHE, I dont know how that space got there :p … fixed it now

Comment by Jo | November 17, 2007 @ 7:49 am

Hi, Its good tip.

What if you want to use mssql i.e an external db. Tried to apt-get source php5 so that i can compile the mssql.so but always getting error.

Comment by thinyai | November 19, 2007 @ 10:15 am

I too got tripped up with the test.php space, I thought something was wrong with the install.

I did mine with synaptic packet manager but great to see the command line version, next time I will do it that way.

Thanks for the tutorial, was helpful.

Ubuntu 7.10

Comment by Raval | November 22, 2007 @ 3:19 am

Hello guys,

I’ve the my apache2, php, and mysql using the above tutorial. It was successfully installed but what i’ve notice is the when i run the phpinfo there’s no mysql enabled there. I’ve tried to uncomment mysql.so in the /etc/php5/apache2/php.ini but still not showing in the phpinfo. Anyone has an idea?

Thanks.

Comment by Duddes | November 23, 2007 @ 4:41 am

I installed phpmyadmin but do not see it anywhere, itsnot in my www folder, how do I get to it?

Comment by Dave | December 1, 2007 @ 8:57 pm

Dave, go to:
http://localhost/phpmyadmin

Comment by Jo | December 2, 2007 @ 12:54 pm

Jo,
that doesn’t work either, 404 error. There is no phpmyadmin folder in my /var/www folder, the only folder I have is a /etc/phpmyadmin folder. Should I just copy it over? Thanks for taking the time to help me.

Comment by Dave | December 2, 2007 @ 9:13 pm

Nice….
But I have problem..
I am using ubuntu 7.10 server.
My server name is ubuntu.
I can’t run php in my localhost
when I run http://localhost/phpinfo.php, save dialog appear.
But http://ubuntu/phpinfo.php, OK and run it.
How to solve it ????

Comment by saturngod | December 3, 2007 @ 5:11 pm

saturngod
open your http.conf and go to the line: ServerName … edit it so it becomes http://localhost/

Comment by Jo | December 3, 2007 @ 5:17 pm

Thank Jo…
How To Edit it ?
My http.conf have

ServerName localhost

only 1 line.

How to change it !!!!

Comment by saturngod | December 3, 2007 @ 5:32 pm

the line should be:

ServerName localhost:80

Also make sure the location of ur file is the same one specified in http.conf

Comment by Jo | December 3, 2007 @ 5:38 pm

Thank Jo…
I testing it…

Comment by saturngod | December 3, 2007 @ 5:44 pm

Hi! Joe…
Not Work :(
I also do that
$ sudo a2enmod php5

But Not Work.. http://locahost/phpinfo.php ( save dialog apperar )
Only work http://ubuntu/phpinfo.php

phpinfo.php at /var/www/

Comment by saturngod | December 3, 2007 @ 6:45 pm

Hi i cant start my phpmyadmin when i type in my explorer http://localhost/phpmyadmin
I see this :
Not Found

The requested URL /phpmyadmin was not found on this server.
Apache/2.2.4 (Ubuntu) PHP/5.2.3-1ubuntu6.2 Server at localhost Port 80
Please tell me what to do My phpmyadmin is not in folder var/www
it is in usr/share/phpmyadmin
Please need help

Comment by Killersoft | December 5, 2007 @ 9:39 pm

Update not work please tell me what to do

Comment by Killersoft | December 6, 2007 @ 10:44 pm

Hi again i am sorry for my post before one hour. It working now http://localhost/phpmyadmin
When i restart my computer it working
Thank tou Very Very much Jo!
I am sorry for my bad english :(

Comment by Killersoft | December 6, 2007 @ 11:42 pm

I m glad it did :)
I think you forgot to restart Apache the first time

Comment by Jo | December 6, 2007 @ 11:50 pm

Hi there, thank you very much for this tutorial, it’s very helpful and has allowed me to successfully get LAMP set-up on my Ubuntu 7.10 desktop.

The problem I have now is that I’m unable to make any changes to the /var/www directory, i.e. I’m unable to add/edit any files in there. I think I know what the problem is, the directory has permissions set to it for root, but as I’m logged in as my user, it’s not letting me do anything.

Now I’m sure that I can use the terminal command sudo gedit to create and edit files in that directory, but this isn’t really solving my problem, firstly because I want to be able to access the files via the file manager, but also because I’m sure it’s not designed so you have to log into the superuser every time you want to do something like this.

This also would not solve the problem of remote access, i.e. either using FTP or windows explorer (via the network) to access the directory. I’m more interested in allowing specific users (such as myself, and my user on my windows machine) to access this folder.

As a result, I think a nice addition to this tutorial would be information on how to do this… Thank you.

Comment by Daniel | December 13, 2007 @ 6:15 pm

Hi Daniel

Try doing ‘ sudo chown OWNER DESTINATION ‘
this will change the owner of all files inside the DESTINATION folder.
if you set OWNER = www . then everyone can access the file.

check ‘ man chown ‘ for more details

Jo

Comment by Jo | December 14, 2007 @ 11:49 am

Hi, thank you for your reply.. I tried running ‘sudo chown www /var/www’, but it just told me there was no user www.

I’ve got it working locally now by using ‘sudo chown daniel /var/www’, which is a step in the correct direction, but as I said before, I’d be very keen on making that directory a shared directory so I can access it via the network from my windows machine.

Thank you

Comment by Daniel | December 14, 2007 @ 7:06 pm

Great job!
I’d only change one thing.
You could test for a valid installation with the following script:

Not only does this test the installation, it shows all of PHP’s configuration information.

Since this message is so far down the page, I hope you’ll add this to your tutorial.

Comment by clarkePeters | December 16, 2007 @ 6:17 pm

that script is

&lt ?php phpInfo(); &gt

Comment by clarkePeters | December 16, 2007 @ 6:19 pm

Well done, ive been looking for ages for a way to install LAMP and this is the first guide i have found that got strait to the point, Thanks

Comment by RyanT | December 18, 2007 @ 2:09 am

[...] 7-Installing LAMP on Ubuntu 7.10 (Linux,Apache,MySQL,PHP) [...]

Pingback by Dr-Hamza’s Space | December 25, 2007 @ 7:33 pm

hello world
i have installed Ubuntu 7.10 from a dvd which apparently doesn’t have the next packages : apache,mysql ,php,phpmyadmin,java and maybe other stuff which a developer might be interested in…
how the hell is that possible and what solution do you suggest,if any ?
Thx.

Comment by alin nemet | December 27, 2007 @ 4:06 pm

An excellent tutorial – many thanks for that.

Two very minor points.

1) Where you say edit php.ini and add to it this line : ” extensions=mysql.so” if it isnt already there

The word extension should be singular. The line should be
extension=mysql.so

2) The apt-get install of phpmyadmin created a link from /etc/apache2/conf.d/phpmyadmin.conf to /etc/phpmyadmin.apache.conf, so adding the line to /etc/apache2/apache.conf is unnecessary. Included twice the file triggered a warning from Apache. The alias was hidden by an earlier alias or similar. You either need the link or the line in /etc/apache2/apache.conf, not both.

Comment by Ian | January 2, 2008 @ 2:14 am

[...] this took a while (20,000+ images, remember?), I set up LAMP, which was easy to do by following this blog post. See, I needed to update the MySQL database to match up the parts with the images. To work out the [...]

Pingback by Ubuntu at work « Me and U(buntu) | January 3, 2008 @ 5:58 pm

Hi,

Very nice tutorial!

One minor issue though is that phpmyadmin installs to /usr/share/phpmyadmin (at least on my computer). That is probably why some of you get a “site not found error” when trying localhost/phpmyadmin. And that is because the phpmyadmin files is simply not in the /var/www directory. I solved the problem by creating a link:
cd /var/www
ln -s /usr/share/phpmyadmin phpmyadmin

and now it works fine…
/Dan

Comment by Dan | January 3, 2008 @ 9:59 pm

[...] Installing LAMP on Ubuntu 7.10 (Linux,Apache,MySQL,PHP) at FARAWAY Published by admin on 11月 14, 2007 in 02留学咨询. 想试用一下Ubuntu,下载的是桌面版,但是想做个web服务器出来,找了n久找了这么个教程 Installing LAMP on Ubuntu 7.10 (Linux,Apache,MySQL,PHP) at FARAWAY [...]

Hi how i can change the ip of the apache so i dont get tha message? apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

Comment by Xhaar | January 28, 2008 @ 3:26 pm

Just wondering….is MySQL necessary for LAMP?
Thanks

Comment by That Guy | February 2, 2008 @ 2:24 am

Be sure if you just installed Ubuntu and just did all the new updates, you need to restart before the apt packs will install. You will get an error saying that the file can’t be found. So…

1) install ubuntu
2) do all updates
3) restart
4) install LAMP using above methods

works ;)

Comment by Shudogg | February 6, 2008 @ 2:47 am

well i installed ubuntu server LAMP, when i start it takes me to GRUB, how do i accualy get on ubuntu.

Comment by Ostap | February 6, 2008 @ 3:50 am

I can not access phpmyadmin from the localhost/phpmyadmin in my browser. I tried to reload phpmyadmin then placed this command in the terminal prompt like suggested:
sudo vi /etc/apache2/apache2.conf

After that I’m supposed to put this phrase:
Include /etc/phpmyadmin/apache.conf

How do I do this and will this fix the problem of accessing phpmyadmin.

Thanks for your help

Comment by drarncruz | February 8, 2008 @ 8:29 am

Thanks,very nice tutorial!

I just wanted to ask, what should I install or configure to run python scripts?

Thanks again.

Comment by miskas | February 9, 2008 @ 12:05 pm

Thanks alot for this tutorial. If you run a home network, I dare you to check this out http://aflog.org/misc.php

Comment by That Guy | February 10, 2008 @ 11:11 pm

Nice tutorial…great help while setting up a LAMP server for the first time!

Comment by Bas Slagter | February 11, 2008 @ 9:31 pm

thanks !! First time I can install LAMP on my Gutsy…. thanks again. It’s nice tutorial

Comment by wahju | February 14, 2008 @ 2:44 pm

First time trying to install LAMP….. worked previously with WAMP

Great Tutorial!!!!!!

Comment by Arun Srinivasan | March 9, 2008 @ 8:13 pm

hi jo.,
i have installed lamp successfuly as u said,,, and iv tried working out all siple php programs and they do work… but the problem is when im working on a program that links php to mysql it shows an error which says “undefined call to mysql_connect on line watever it appeared…
i would be very thankful if u cud tell me something about this..
Thanks..

Comment by sweetgal | March 10, 2008 @ 8:19 pm

G’day ;)
I’ve just installed Apache on my private web server (for testing sites) and when it runs non-scripted files (.html and the like) it’ll display them.

Though, when I try to run a PHP file it comes up with a dialog box asking me to download a .phtml file.

What do I need to do to configure it properly?

Cheers,
Seb.

Comment by seb|kaz | March 14, 2008 @ 10:14 am

sudo tasksel install lamp-server

Works perfectly

Comment by Steven | March 14, 2008 @ 8:37 pm

Also -

** Webmin is useful as is phpinfo()
** You can also install the Ubuntu LAMP via

SYS->ADMIN->SYNAPTIC->EDIT->MARK PACKAGES BY TASK->LAMP SERVER

Comment by Robert | March 15, 2008 @ 2:39 pm

[...] Follow the LAMP Installation Walkthrough (using Ubuntu, a popular distribution of Linux recommended for beginners) [...]

well
the php installation part…
it doesnt run the php itself instead it just displays the code ;/
how to fix that?

thx

Comment by sam | March 21, 2008 @ 12:54 pm

[...] 3 – Install LAMP – Thanks to Joe Raad for the wonderful walk-through. If you follow his instructions, you’ll [...]

Thanks Joe, you really made the process a heck of a lot easier for me. I wish everyone’s tutorials were so straight to the point and easy to follow.

Comment by Ubuntu Novice | March 31, 2008 @ 9:31 am

..oh.. and if anyone is trying to get rails up..
here a walk-through

Comment by Ubuntu Novice | March 31, 2008 @ 9:33 am

hey sam,

“Example:
sudo gedit /var/www/test.php

and write in it: ”

dont give a space between ‘<’ and ‘?’
the structure

tells that there is some php code in between.
so the correct code to test would be –

Comment by Jai Pandya | April 6, 2008 @ 9:38 am

Installing LAMP on Ubuntu 7.10 (Linux,Apache,MySQL,PHP)…

Lately I’ve been using ubuntu 7.10 for all my projects/daily work.
As a web developer i should have LAMP on my machine and now i would guide you through installing it on yours.
This guide is divided into 3 steps: installing/tesing Apach… ……

Trackback by oasis|latin | April 16, 2008 @ 8:12 am

Hey Joe,
Thanks for the tutorial. I too am new to the linux world. I need help and wanted to know if you have installed and used PHPmailer? If so any help you can give would be greatly appreciated.

Scott

Comment by Scott | April 21, 2008 @ 10:35 pm

[...] Installing LAMP on Ubuntu 7.10 (Linux,Apache,MySQL,PHP) [...]

Hi there, thank you for your useful guide.

I took the liberty to make a spanish translation of it and add a little extra bit to it, at:
http://lobotuerto.com/blog/2008/04/30/como-instalar-lamp-en-ubuntu-804/

Comment by Lobo tuerto | May 1, 2008 @ 5:28 am

[...] references used to achieve (and write) this were LAMP Installation On Ubuntu, Installing LAMP on Ubuntu 7.10 and Installing and configuring LAMP on [...]

Useless guide. Lamp from ubuntu repositories has default configurations that are only usefull if you intend to play a litle, otherwise you better install from source so that it gets configured as you want.

Comment by martins | May 9, 2008 @ 12:01 am

Hi
I am using ubuntu 8.04 and This lesson not work propertly for ubuntu 8.04
Can you tell me how to setup my LAMP server on ubuntu 8.04
I will be very happy becose i am a new in unix OS
Thanx & Sorry for the bad english

Comment by Killersoft | May 10, 2008 @ 12:50 pm

great tutorial, making setting up real monkey work

Comment by yvan | May 15, 2008 @ 10:14 am

Hi great tutorial.

Just 1 Q, will this work for Ubuntu 8.04 aswell?

Comment by the other guy | May 21, 2008 @ 2:03 pm

Hey,

yes it will work on ubuntu 8.10 as well

// Jo

Comment by Jo | May 21, 2008 @ 2:29 pm

[...] first thing I did was instal LAMP, this newbie tutorial basically shows you how to install LAMP via the terminal. I also installed phpmyadmin [...]

Worked Perfectly for Ubuntu Hardy,

Awesome Guide,
Thanks,

Comment by Nishars | June 3, 2008 @ 9:51 pm

Excellent tutor Jo!

Thanks for the sharing. In several minutes i already have my local server environment, great!

just one attempt and i can use it now.

Comment by megat | June 23, 2008 @ 5:56 am

hi every body i am new to linux i lamp in my ubuntu linux 8.04 .i successfully installed it the only problem is when i disconnect the internet phpmyadmin and php is not working it showing an error page but apache is running i want to run phpmyadmin and php when i disconnect the internet could any one tell the solution for this problem

Comment by A R Mohamed Ismail | June 28, 2008 @ 4:03 am

About getting the 404 not found error, Dans suggestion on using the symbolic link worked for me. Thanks!

Comment by Jeremy | July 1, 2008 @ 1:29 am

Steve posted the command

sudo tasksel install lamp-server

a ways back. Have a look at these;

https://help.ubuntu.com/community/ApacheMySQLPHP
https://help.ubuntu.com/community/Tasksel

Makes life even easier.

Comment by JoeM | July 1, 2008 @ 1:37 pm

Hi JO,

Please can you help me….? I’m begining my firsths steps with Ubuntu and the first time I installed lamp on Ubuntu 8.0 in a new HD I followed your instruction I didn´t have problems.
for reason that i don´t know the O.S. begun to freeze. I reinstalled Ubuntu but when I want to install lamp, it show me a message it doesn´t find the package….!
What shuold i do…..?

thanks

LY

Comment by Luis | July 13, 2008 @ 4:19 pm

A big THANK YOU.

It all worked right the first time.

RP

Comment by Rick Pizzi | July 19, 2008 @ 3:54 am

Thank you very much!

Comment by jdk137 | July 29, 2008 @ 4:23 pm

[...] Installing LAMP on Ubuntu 7.10/8.04 (Linux,Apache,MySQL,PHP) Published by Jo on November 5, 2007 in Linux/Unix, PHP, Tutorials and Ubuntu . Tags: Apache, LAMP, Linux, MySQL, PHP, Ubuntu. [...]

well first of all congratulations for this super tutorial

i have some questions please if someone can help i will appreciate it >>

my questions are where the passwords were stored from phpmyadmin and what i can do whit it (phpmyadmin) ?
what’s the difference b/ween phpmyadmin and php5 or why we install phpmyadmin?

thanks
:)

Comment by kromos | August 1, 2008 @ 6:21 am

Hi Kromo,

phpmyadmin is used as a web interface for mysql and not a php language.
So basically phpmyadmin and php5 are 2 different things

// Jo

Comment by Jo | August 1, 2008 @ 6:30 am

Hi all,
this is a very useful article, particularly for a person who is not familiar with Linux (Ubuntu), I’m having a small problem setting the password for mySQL, I’m getting the following when I set the password:
set password for ‘root’@'localhost’ = password(‘xxxxxx’);

ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘mysql’

What am I doing wrong.

Comment by Daniel P | August 1, 2008 @ 8:41 am

hi daniel p

have you try this?

mysql -uroot -pxxx

where pxxx = your password

Comment by kromo | August 2, 2008 @ 2:48 pm

Thanks for the great tutorial. Everything worked perfectly ;)

Comment by KenV | August 20, 2008 @ 3:49 pm

Great tutorial.

Thanks for publishing this!

Comment by loz | August 24, 2008 @ 9:32 pm

[...] .5-Installing Lamp on ubuntu ( 2 parts )6-Newbies – Quick LAMP howto – Ubuntu ( Ubuntu Forums )7-Installing LAMP on Ubuntu 7.10 (Linux,Apache,MySQL,PHP)Powered by [...]

This is really good tutorial thought I would have used:

sudo /etc/init.d/apache2 force-reload

To complete the phpmyadmin installation.

Comment by LIMI-IT | September 24, 2008 @ 10:07 pm

Hi Jo, all works perfectly in my xubuntu 7.10.

Thanks a lot.

alexisrlm

Comment by alexisrlm | October 9, 2008 @ 6:40 am

Just found your great tutorial. Thanks so much for the original write-up and updates! I got everything running on Ubuntu Hardy in about 20 minutes (about 10 times faster then my last MAMP install on a WinxP box).

The only thing I think you overlooked that may solve some peoples issues is to tell php where you php pages will be loaded from. To do this find the line in the php.ini file that says: doc_root = and add: /usr/var/www/ (or whatever your path to web root is).

i.e: doc_root = /usr/var/www/

Comment by Kai | October 20, 2008 @ 12:20 am

i just wanna thanks for this tuturial.

Comment by Aurelio Pita | October 28, 2008 @ 11:03 pm

Thanks for install guide … it is working very fine….

Comment by senthilmurugan | November 5, 2008 @ 7:45 am

Hey Jo,
Thanks a lot for giving this point to point Guide to install lamp. we are also looking for more tutorial and guide from expert guys like you.
We are heartily appreciate your efforts, Gr8, Rock on!

Comment by Jatin Meshiya | November 5, 2008 @ 8:18 am

really good as one new to linux
thanks a lot !

Comment by Adhan | November 11, 2008 @ 10:33 pm

[...] just Linux, Apache, MySQL and PHP. All need to be installed separately but its easy in ubuntu. See (http://joeabiraad.com/linuxunix/installing-lamp-on-ubuntu-710-linuxapachemysqlphp/100 ) Make sure to do the ‘phpmyadmin’ install. Apache does not get proper access to mysql [...]

great article you made it damn easy

Comment by santosh | December 14, 2008 @ 1:31 am

Thank you so much for this useful information. It was really helpful in setting up an environment for me to test my PHP codes in.

Comment by Maki | December 31, 2008 @ 6:14 pm

thank you for an excellent guide

however i couldn’t get firefox to display your hello world php5 file
i needed to change the syntax to this:

Comment by itai-michaelson | January 5, 2009 @ 9:01 am

i successfully installed apache php and mysql on my ubuntu 8.10. But i have a problem saving my php file on var/www folder. I know that this is regarding user permission problem but how can i solve this?..
Is there an easy way to save my php file so i can test it any time i want

Comment by leo | January 5, 2009 @ 7:34 pm

Thank you, very useful.

Comment by Paul | January 9, 2009 @ 11:28 pm

JO:

New to Linux, just escaped from XP :)
This tutorial is fantastic! Took me 10 mins with copy and paste and everything worked perfectly!

Thanks!

For newbies who have asked (and doesn’t seem to be answered, although is a huge list of replies and I may have missed it)
/var/www
is where you copy and edit your files
http://127.0.0.1
is the default location in your browser to access the files in /var/www

http://127.0.0.1/phpmyadmin in the browser
loads a familiar sight that you are looking for :)

LEO: You can change permissions on the folder, but a better option is to change the owner of the folder to yourself
sudo chown -R YOURUSERNAME:users /var/www

Then copying, deleting and editing from a HTML editor will work fine as you own the folder

Comment by Greg | January 19, 2009 @ 3:43 am

hey thanks a lot.. actually i have already an idea about changing the permission and i search it already on the net, its just that all of their sugestion or their command on the terminal like so the chown command is not working…many thanks for that…now i can practise my programming abilities again because my boss told me to transfer from tech to programmer…

Comment by Leo | January 19, 2009 @ 3:38 pm

hey thanks a lot.. actually i have already an idea about changing the permission and i search it already on the net, its just that all of their sugestion or their command on the terminal like so the chown command is not working…many thanks for that…now i can practise my programming abilities again because my boss told me to transfer from tech to programmer…

Comment by Leo | January 19, 2009 @ 3:38 pm

Excellent!

Followed the instructions with Ubuntu 8.10 with 2.6.27-7 kernel.

The mysql install now will prompt you for the password for root.

Comment by Linda | January 29, 2009 @ 6:01 pm

[...] το τελικό αποτέλεσμα! Hope you make it! Χρήσιμοι Σύνδεσμοι LAMP infoWordPress.Org InstallWordPress.Org themes Μοιραστείτε τη δημοσίευση: [...]

[...] Linux ( LAMP ) [ho utilizzato questa procedura per l'installazione sul mio portatile su cui ho Ubuntu 8.10] [...]

Pingback by DaL LoRe » Blog Archive » [PHP] Start | February 20, 2009 @ 12:25 am

[...] Here are the 2 blog posts which helped me :  by wulfshayde and from here [...]

Thanks for the nice guide mate. It really helps me.

I’m doing web dev at almost 3 years now in Win environment. I like to take things deeper (sometimes it not always good being spoon fed if in Windows) by getting it at Linux.

More power to open source!

Comment by cxian | March 1, 2009 @ 4:07 pm

Hi! I like this guide… It’s complete and comprensive. At this moment installing on LinuxMint without problems… Thanks for the information! Bye.

Comment by Jhon F. Ortiz O. | March 7, 2009 @ 5:12 pm

Thanks it works.

Comment by Ruben | March 9, 2009 @ 6:43 pm

Hello,

thanks for your tutorial, like this much better then using tasksel.

Although I missed
$ sudo apt-get install php5-cli

(You will get this error message when you try to compile a php file without it)

Comment by eddy | March 11, 2009 @ 3:37 pm

Simply awesome write-up. I was looking for such a brief, straight tutorial for LAMP configuration. You did a great work Jo !!!

Thanks a lot :)

Comment by rakesh | March 22, 2009 @ 7:37 pm

For starting and stopping the server there is also a command.
As somebody earlyer started and stopped through /etc/init.d/
look at:
/usr/sbin/apache2ctl

Comment by harry | March 22, 2009 @ 8:51 pm

Thank you Jo. A simple, easy to follow guide that works!

Comment by Paul | March 31, 2009 @ 5:42 pm

you rule !! Thanks so much. worked perfectly. probably saved me hours of stumbling and fumbling around !!!

Comment by lynn | April 7, 2009 @ 4:46 am

THANKS!!! I have an issue. My test.php is not working. I type in http://localhost/test.php and it just give me the code. No HELL WORLD, just the code. Why is that? I followed your steps to a “T”. Any idea what the issue is?

Comment by Valtor | April 11, 2009 @ 12:29 am

Hello,

Tried posting earlier. But it is gone for some reason. I cannot get my test.php to show the actual test. It just shows the code for PHP. Any ideas on why or how to fix it? I have tried so many things usggested online, and it just doesn’t work. What makes me more frustated, is that I have installed this before with the tutorial and it worked great. But now it doesn’t work.

Great tutorial by the way!

Comment by xlien | April 11, 2009 @ 2:52 am

Good ! Its help me what i tried to find last five days. Thanks

Comment by Rajesh yadav | April 11, 2009 @ 10:12 am

[...] 3 – Install LAMP – Thanks to Joe Raad for the wonderful walk-through. If you follow his instructions, you’ll [...]

thanks about your info for install apache php mysql..
this so useful for me..
thank alot of friend

Comment by rahina | April 27, 2009 @ 3:59 am

[...] useful guide to Ubuntu 9.04 Essential Ubuntu 9.04 guides and manuals Instaling LAMP on ubuntu Ubuntu [...]

I just installed the whole stuff, using the great tutorial you wrote, LAMP is now working on my side ;)

Thanks for sharing the skills.

Comment by designcode | May 31, 2009 @ 12:57 pm

Thanks for the write up! This still works today:) i just set up 2 Ubuntu 8.10 servers using this.

It’s people like you that will help us windows guys make the final move to linux! man it’s so easy with good help and good write ups!

Comment by ThinkMud | July 2, 2009 @ 4:02 pm

Hi

This is Very usefu1 ,,, i rea11y thanfu1 t0 j00000000

Comment by Nagaraja | July 3, 2009 @ 4:14 pm

how will i edit the bind-address when it is read-only? please help me.

Comment by jeux | August 10, 2009 @ 6:56 am

[...] Ubuntu: Installing LAMP on Ubuntu 7.10/8.04/8.10/9.04 (Linux,Apache,MySQL,PHP) VN:F [1.6.3_896]please wait…Rating: 0.0/10 (0 votes cast)VN:F [1.6.3_896]Rating: 0 (from 0 votes) [...]

Pingback by TrustedBux » Ubuntu linux | September 2, 2009 @ 11:31 am

Now just for the guys who were getting 404 error. By default the phpmyadmin gets installed in /usr/share/phpmyadmin (atleast in case of ubuntu) Just copy the folder to /var/www/ and Voila. Phpmyadmin works.
BTW thanks geeeks.

Comment by Suryanshu | September 8, 2009 @ 12:56 pm

Thanks, Joe. I really appreciate you adding specific notes for those of us who are trying not-quite-typical installs and for having the good sense to let us know what the results of each step are as well as how to ensure they were successful. You are a brilliant example for technical writers everywhere.

Comment by sohlside | November 4, 2009 @ 6:25 am

anyone can help me ?i am getting error message while installing php ,apache
the error message is:-E: Couldn’t find package apache2
i am also didn’t insert in to root though i gave true root password

Comment by get error message | November 28, 2009 @ 6:36 am

yogesh@yogesh-desktop:~$ sudo apt-get install apache2
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Couldn’t find package apache2
yogesh@yogesh-desktop:~$ su root
Password:
su: Authentication failure
yogesh@yogesh-desktop:~$
………………………………………………
pls help me in install php i am getting above error

Comment by get error message | November 28, 2009 @ 6:57 am

thanks a lot!! was of great help!

Comment by siri | December 2, 2009 @ 8:58 pm

Excellent tutorial. I followed it and got everything up in less than 30 minutes. I do have one question. How do you start the admin function for Drupal? I keep getting the following when I try the following.

http://localhost/admin

shows a 404 not found.

Is that the correct url to go to, and start drupal. Let me know. Thanks.

Shark….

Comment by Gary | December 18, 2009 @ 9:27 am

[...] si another guide to installing a LAMP server on Ubuntu here, which also usefully lists the command to download phpmyadmin for mySQL databases var addthis_pub [...]

In spanish –> http://www.hasheado.com/instalar-apache-mysql-y-php-en-ubuntu.html

Comment by Marcos | January 7, 2010 @ 4:19 am

Thank you so much. it’s very useful for beginners like me .(Y)

Comment by Mohamed Gamal El-Din | March 10, 2010 @ 5:04 pm

Hello,
Nice tutorial for beginners like me. Now my problem is different. apt-get finds latest version of php say its php5.3 and lots of open source framework like Drupal, magento has still not adopted it properly. so they recommend php5.2.x to use. can you post code for installing php5.2?
instead of following what should be used ?


sudo apt-get install php5 libapache2-mod-php5

Hopefully this will help to lots of other person. And if you have any idea that how to downgrade from php5.3 to any version of php5.2 than please post that also.

Thank you
Tejas Mehta

Comment by Tejas Mehta | April 3, 2010 @ 8:16 am

tank is very work 100% to my computer linux by ubuntu 9.10 god tuto

Comment by tckalexon | April 19, 2010 @ 4:35 am

i am new for linux environment … this page is really superp and it was helpful for me

Comment by Albert | August 27, 2010 @ 2:45 pm

thanks.its work well.so i need all software installation commands in ubuntu.i am new for linux environment

Comment by mathi | September 24, 2010 @ 9:29 am

thanks really nice very helpful……………………….

Comment by niharika | October 21, 2010 @ 4:40 pm

a good spanish translation service does not cost that much and is actually very affordable `

Comment by Fish Oil : | October 31, 2010 @ 12:04 am

i use google when i want to do some spanish translation, it is good for general spanish translation .-~

Comment by Pat Kroner | November 18, 2010 @ 11:41 am

Hello all :)
I am a beginner in Linux.
Please I want to know how I can install and configure Drupal on Linux (Ubuntu).
Thanks…

Comment by Elie | January 9, 2011 @ 2:08 am

Hello
I am also a newbe in Ubuntu installed like you told me but I face problems connecting PHP to Mysql.
I used SQL on an IBM-mainframe but under PHP life is different.
When I tried to connect in a PHP5 coding i got he result:

Warning: mysql_connect(): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) in /var/www/inw.php on line 15

Whats is wrong?
I have Ubuntu 10.04
Thanks and greetings from Rene Geul

Comment by RENE | January 12, 2011 @ 2:44 pm

Problem solved.
I did bind-address in /etc/mysql/my.cnf back to 127.0.0.1 and it works again.
Setting an ip-adress is difficult because on this computer there are a few Ip-adresses and I do not know what is what, so be carefull.

Comment by RENE | January 13, 2011 @ 2:35 pm

[...] configuration to do relating to users and permissions.  I’ve modified the instructions from another blog post so that you can install Drupal, starting from a vanilla Ubuntu 10.04 [...]

How to unistall that all? i want to install XAMPP but before that i need to remove the existing settings.
Don’t say that i needn’t remove it. May be i not but i want to remove that by ANY way
Thanks!

Comment by Chand | March 18, 2011 @ 12:37 pm

Installing LAMP on Ubuntu 7.10/8.04/8.10 (Linux,Apache,MySQL,PHP ……

[...]Lately I’ve been using ubuntu 7.10 for all my projects/daily work. As a web developer i should have LAMP on my machine and now i would guide you through installing it on …[...]…

sleeve tattoo gallery,

Comment by Zxkpsdaa | July 4, 2011 @ 11:41 am

I have done everything advised by you. Yet I am getting the ‘Unable to connect’ screen in firefox. Same with http://localhost or http://127.0.0.1 or http://localhost/phpmyadmin or http://localhost/test.php. Could you suggest a solution.

Earlier I used to get ‘It works’ screen. But php5 did not work at that time. Now, nothing is work. When I start the apache2 using sudo /etc/init.d/apache2 start (or restart), it says [OK]. Earlier it used to say for some days ‘no listening sockets etc.’. Now nothing of that sort. The server says OK to start/restart. But when I type the http://localhost in firefox I get ‘unable to connect’.

Comment by ybhask | August 9, 2011 @ 12:52 pm

Hey very cool blog!! Guy .. Beautiful .. Wonderful .. I will bookmark your site and take the feeds additionally…I’m glad to seek out so many useful information here in the publish, we’d like work out extra strategies on this regard, thank you for sharing.

Comment by can you get an ex back | August 25, 2011 @ 1:02 am

Thank you very much….
I just moved to windows to Linux(Ubuntu) and it helped me like clear and cut… thanks

Comment by Anil | August 27, 2011 @ 5:37 am

[...] Installing LAMP on Ubuntu  (Linux,Apache,MySQL,PHP) Share this:TwitterFacebookLike this:LikeBe the first to like this post. [...]

Pingback by Ubuntu Guys !!! lets familize it « anil3a | August 27, 2011 @ 6:22 am

i install my lamp server and it already works but when i place my web folder inside var/www it doesnt my web display it but the index.php of the lamp server is being display and said that it works..

help please..

Comment by Kai | October 13, 2011 @ 2:33 am

simple and straight forward! great stuff! thanks for writing!

Comment by Kamran | November 23, 2011 @ 2:18 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment