They offer different flash templates with latest features.
Login

Forgot password
Register
Back
Written by:
mysoomro
Score: 119
votes: 128
Format: Article

 Installing LAMP (Linux, Apache, MySQL and PHP) On Linux Mint


Installing LAMP (Linux, Apache, MySQL and PHP) On Linux Mint

Through this tutorial, you'll learn how to Install Apache, MySQL and PHP.

If you're a webpage designer or developer and use PHP, mySQL and Apache, you'll be needing these applications to be installed. When I istalled Mint, I was looking for a way to install LAMP and found a tutorial on a website by somebody named "Cargoship". That tutorial was for ubuntu. But I installed it on my Linux mint, and it is working.

 

 

In this guide I will show you how to install a LAMP system. LAMP stands for Linux, Apache, MySQL, PHP. The guide is intended to help those who have very little knowlegde of using Linux.

 

We will not cover how to install Linux the L of LAMP, because Linux Mint is already installed in your computer.

 

Install Apache

To start off we will install Apache.

1. Open up the Terminal (Applications > Accessories > Terminal).

2. Copy/Paste or type the following line of code into Terminal and then press enter:

sudo apt-get install apache2

3. The Terminal will then ask you for you're password, type it and then press enter.

 

Testing Apache

To make sure everything installed correctly we will now test Apache to ensure it is working properly.

1. Open up any web browser and then enter the following into the web address:

http://localhost/

You should see a folder entitled apache2-default/. Open it and you will see a message saying "It works!" , congrats to you! or something like that!

 

Install PHP

In this part we will install PHP 5.

Step 1. Again open up the Terminal (Applications > Accessories > Terminal).

Step 2. Copy/Paste or type the following line into Terminal and press enter:

sudo apt-get install php5 libapache2-mod-php5

Step 3. In order for PHP to work and be compatible with Apache we must restart Apache. Type the following code in Terminal to do this:

sudo /etc/init.d/apache2 restart

 

Test PHP

To ensure there are no issues with PHP let's give it a quick test run.

Step 1. In the terminal copy/paste or type the following line:

sudo gedit /var/www/testphp.php

This will open up a file called testphp.php.

 

Step 2. Copy/Paste this line into the phptest file:

 

<?php phpinfo(); ?>

Step 3. Save and close the file.

Step 4. Now open you're web browser and type the following into the web address:

http://localhost/testphp.php

 

(It will show you the page that has all information about your php. If you have prior experience of installing php in some other OS, you must have seen this page.)

Congrats you have now installed both Apache and PHP!

 

Install MySQL

To finish this guide up we will install MySQL.

Step 1. Once again open up the amazing Terminal and then copy/paste or type this line:

sudo apt-get install mysql-server

Step 2 (optional). In order for other computers on your network to view the server you have created, you must first edit the "Bind Address". Begin by opening up Terminal to edit the my.cnf file.

gksudo gedit /etc/mysql/my.cnf

Change the line

bind-address = 127.0.0.1

And change the 127.0.0.1 to your IP address.

(In Linux Mint 11, terminal itself asked to the set password, But if it doesn't follow the step 3.)

Step 3. This is where things may start to get tricky. Begin by typing the following into Terminal:

mysql -u root

Following that copy/paste or type this line:

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');

(Make sure to change yourpassword to a password of your choice.)

Step 4. We are now going to install a program called phpMyAdmin which is an easy tool to edit your databases. Copy/paste or type the following line into Terminal:

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

After that is installed our next task is to get PHP to work with MySQL. To do this we will need to open a file entitled php.ini. To open it type the following:

gksudo gedit /etc/php5/apache2/php.ini

Now we are going to have to uncomment the following line by taking out the semicolon (;).

Change this line:

;extension=mysql.so

To look like this:

extension=mysql.so

Now just restart Apache and you are all set! 

sudo /etc/init.d/apache2 restart

 


If you get a 404 error upon visiting http://localhost/phpmyadmin: You will need to configure apache2.conf to work with Phpmyadmin.


sudo gedit /etc/apache2/apache2.conf


Include the following line at the bottom of the file, save and quit.

Include /etc/phpmyadmin/apache.conf

 

Then just restart Apache

sudo /etc/init.d/apache2 restart

 


 

 

 

Now make wonderful website and have fun!wink

Terminal scares the newbies, but here, you'll see how magical terminal or comand promt (whatever you call it) is.

And as Linux is very secure OS, it'll ask you the password again and again, on every administrative command. You'll have to type in your password many times, whenever terminal asks for it.

 

The End


Tags: terminal, gedit, browser (firefox).
Created: 3 years ago.
Last edited: 2 years ago.
Reviewed: 2 years ago.
Read 2013 times.

Comments
11 hours ago

mysoomro
I'm so sorry guys for being absent for a long time.
actually I'm stuck somewhere else.
Only can see the notification when someone sends me a message...
@lhs182 about it. are you sure this has permanently changed for all mints??
I haven't checked it. And if we change it we have to be positive that it has changed or it'll create some problem for other people.
 
2 days ago

pierre_1999
why is gksudo gedit /etc/mysql/my.cnf used instead of simply sudo vi /etc/mysql/my.cnf ? Is there a reason or they are interchangeable on this occasion? Thanks for the tutorial.  
3 weeks ago

lhs182
Thanks a lot! This was great!!! Very easy and fast.


Just the sudo gedit /var/www/testphp.php, in my case, I had to put the testphp.php inside the /var/www/html to work


 
1 month ago

Palchuhai
Thank you!  
1 month ago

shahbaz_manzil
Thank you mysoomro.

I successfully installed LAMP with this tutorial. It saved me a lot of time. God bless you.

Still I was short on understanding the server configurations. For any others facing the situation, the following guide helped me - http://howtolamp.com/lamp/.

Go through the steps after installation and you must understand which configuration files do what.

And for the log files, the following
http://howtolamp.com/lamp/mysql/5.6/log-files/
http://howtolamp.com/lamp/httpd/2.4/log-files/
http://howtolamp.com/lamp/php/5.5/log-files/

Warning though...The location of log files may vary in Mint
 
2 months ago

jharris1993
@earlgray,

Check the permissions of the files in /etc/apache2 using "ls -l" from a terminal window (of course, you have to be *inside* the directory for that to help you! :-) )

If the "httpd.conf" file's permissions are different, make them the same and then try again.

Another note that I discovered while trying to install WordPress, (and this may be the same for other installed apps in your web server's "www" directory).
**You must change the user and group of all these files to be the default "apache2" user, or you will get strange and bizarre errors involving permissions.

The way you do this is:
First: Go to your /etc/apache2 directory and there should be an apache2.conf file there.
(Note that I do **NOT** have my box up or open right now, so I am doing this from memory!!)

Second: Somewhere in that file, down near the bottom I think, should be something that mentions the default user name. In my case it was something like "www_data" or "www_user" (or something like that, again, I'm doing this from memory)

Third: Once you discover what that default user is, chown everything in your /var/www directory - and all subdirectories - to that user.

Viz.: (as root, or "sudo" all these commands)
"cd /var/www" (or wherever your web root directory is.)

Note that before executing the next command, you **must** be within the /var/www directory, or wherever your web root directory is!

"chown -R www_data:www_data ./*"

The "-R" tells chown (change owner) to recursively go into every sub-directory and make changes there too.

The "www_data:www_data" tells chown to change the user:group to www_data, or whatever your apache default user is, though my money's on it being something like "www_data"

The "./*" part tells chown to start *in the current directory*, and change *everything there* If you remember, the "-R" tells it to keep going into all the sub-directories underneath "./" - the current directory - and change that stuff too.

Bottom line, if you run into weird issues, make sure you check ownership and permissions in each directory for all files you make, since "sudo" and root make files with "root:root" as the owner.

What say ye?

Jim (JR)
 
3 months ago

earlgray
PS I since learned that 'gedit' wasn't installed so installed it and followed the instructions as written, specifically typed "sudo gedit /etc/apache2/httpd.conf" into Terminal, and that opened a blank file called "httpd.conf" into which I typed "ServerName myservername", saved and closed the file. Then re-started apache2 ... same ugly message.  
3 months ago

earlgray
Unfortunately I can't get past Step 3 of Install PHP and getting the message "sudo /etc/init.d/apache2 restart * Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message".
Following @jharris1993 's tip, type in "sudo gedit /etc/apache2/httpd.conf" I get the result "sudo: gedit: command not found"

Any suggestions? BTW, I'm running Linuxmint 16.




sudo gedit /etc/apache2/httpd.conf
sudo: gedit: command not found
 
3 months ago

tz_earl
This was a very helpful set of notes, including the recent comments @jharris1993 which I also read through first before beginning the install.

I did not have any major problems with installing the following stack.

Linux Mint 16
Apache 2.4.6
MySQL 5.5
PHP 5.5.3-1ubuntu2.3

Here are a few notes, some reiterating what other commenters have already said but still current as of the above versions.

I'm very new to Linux, so I'd appreciate others correcting my misunderstandings of how things work under the hood.

-----
(a) Enabling the PHP extension mysql.so

Installing MySQL 5.5 appears to take care of this through the *.ini files found in /etc/php5/apache2/conf.d so that there's no need to hand edit the php.ini file to activate this extension as well as others.

-----
(b) libapache2-mod-auth-mysql "is not available ..."

While installing phpMyAdmin using the command,

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

got the error msg that libapache2-mod-auth-mysql "is not available ..." etc etc.

So I installed without it. So far the stack seems to be working fine without that package.

-----
(c) Browsing to the url http://localhost/phpmyadmin

Installing phpMyAdmin apparently created the file

/etc/apache2/conf-enabled/phpmyadmin.conf

which aliases the url to /usr/share/phpmyadmin

-----
(d) Setting the MySQL root password.

During the install of MySQL, a keyboard-based dialog box popped up in the terminal window to prompt for a password for the root user. So there's no need at all to set the password after the install by using the mysql command line utility.

-----
A very nicely written tutorial with some good details and explanations.
 
4 months ago

jharris1993
First, I owe you, bigtime! I've been trying to bring up a LAMP server on Mint-13 (Mate, 64 bit) for about two days or so, and was getting nothing but grief. Then I found your tutorial and I accomplished more in two hours than I had in the previous two days!!

A couple of additional notes that you might want to include:

1. I did the steps in ths tutorial *before performing ANY updates* on my system after a fresh install, since I noticed that the update mamager wanted to update Apache2 - and I didn't know if that would help or hinder. Maybe it does not matter, maybe it does, I don't know. What I *DO* know is that it worked when I did it this way.

2. After installing Apache2, it's a virtual certenty that you will get a "Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName" error.

The fix is easy, just "sudo gedit /etc/apache2/httpd.conf", and add the one line "ServerName (whatever your hostname is)". Don't include the quotes, (Doh!), and replace "(whatever your hostname is)" with the name you gave to your computer when you set it up. If you don't remember, just type "hostname" in a terminal window, and it will tell you.

Restart Apache2 and this annoying warning goes away.

3. In my case, (Mint 13, Mate), there was no need to edit the /etc/php5/apache2/php.ini file. The commented line was not there, and apparently was not needed, since phpAdmin works anyway.

4. When you go to install phpMyAdmin, it will ask you to create a database for phpMyAdmin to play with, and I selected "Yes". It asks for the password for the "administrative user" - and it sounds like it wants to create another password for yet another user. What it *really* wants is the password you created for the root user when you installed MySQL. If you get this wrong, you get a really scary warning. If you get that warning, just allow it to "retry", and carefully type in the root password you created before.

5. I did not have to do anything to configure Apache2 to work with phpMyAdmin. It worked wonderfully right out of the box.

6. I noticed that phpMyAdmin *does not require any credentials* to access the MySQL databases! Maybe that's a result of the database I created before, I don't know. It *IS* scary!

In any event, I feel like I should send you a case of the finest Kentucky Sour-Mash Bourbon Wiskey - you saved me so much grief!

Thanks a LOT!

Jim (J.R.)
 
4 months ago

kikass
Good tutorial. Don't know how about others but in my case I had to use argument "-p": mysql -u root -p (Installing MySql step3), otherwise You should get this: 'ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)'.  
4 months ago

mint_fan
It worked for me...Thanx  
4 months ago

dragondon
@Felicity Google is your friend. Please learn how to use it. https://stackoverflow.com/questions/20458641/package-libapache2-mod-auth-mysql-is-not-available  
5 months ago

Felicity
Thanks a lot for the instructions, really easy to follow. But I have a problem at the 4th step. Any hint?

Package libapache2-mod-auth-mysql is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libapache2-mod-auth-mysql' has no installation candidate

My OS Is Linux Mint Cinnamon 64b
 
5 months ago

EmilyWolfess
Thanks this is great, but I only needed apache. I never use the phpmyadmin and sql stuff online. I just write html and add my content through the /var/www/ folder on the drive of the server. I appreciate your great article though  
5 months ago

Tanglang
Thank you!It's useful.  
6 months ago

9z4fz
Excellent help file this is the kind of Initiative that make the diffrence between success and non life satfication .


A+A =A over A
 
7 months ago

gabrieldamon42
Best tutorial I have found yet for installing a LAMP stack. Thank you!  
7 months ago

prdmgr2
Thank you. Followed this tutorial and could setup LAMP. Works OK.  
7 months ago

Hardkiffeur
On fresh LM16 I've the libapache2-mod-auth-mysql install give me a notice : "Aucune version du paquet libapache2-mod-auth-mysql n'est disponible, mais il existe dans la base de données. Cela signifie en général que le paquet est manquant, qu'il est devenu obsolète ou qu'il n'est disponible que sur une autre source" = Deprecated .. But phpmyadmin install ok so ...
Thanks for this tut man ;)
 
7 months ago

ilikepeas
Sorry, fixed the problem myself.
I was having a problem this line
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
And in particular libapache2-mod-auth-mysql so I split it in to
sudo apt-get install php5-mysql
sudo apt-get install phpmyadmin
(deliberately left out libapache2-mod-auth-mysql)
The stupid part was that I somehow forgot the phpmyadmin bit! *facepalm*

Thanks though!
 
7 months ago

ilikepeas
Really great tutorial but unfortunately I've fallen at the final hurdle.
I was getting the 404 error when I started phpmyadmin after restarting apache so I edited the apache2.conf file as shown above however when I restart now, I get this:
sudo /etc/init.d/apache2 restart
* Restarting web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 223 of /etc/apache2/apache2.conf: Could not open configuration file /etc/phpmyadmin/apache.conf: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.

I'm on an x64 build of LM16 if that makes any difference?
 
8 months ago

mx72
REALLY WELL MADE AND WRITTEN ! ESAY but NOT trivial !! thk u !  
8 months ago

sbrown1038
Thanks for this tutorial -- I'm now able to learn PHP with MySQL. However, I just installed another application that requires a curl extension for PHP. The extension is installed but apparently PHP doesn't see it. It says to recompile PHP from source using '--with-curl' when you run configure. Must I uninstall PHP and install from source to accomplish this?  
8 months ago

Mashly
Yep, this worked well so far for me, Thankyou.  
8 months ago

irwandermawan
It's very usefull for me, thank you. i use pluma for text editor to create testphp.php file.  
9 months ago

jasperguy
nicely done, thank you. It is now installed on:

linux mint 15 cinnamon 1.8 olivia
512 mb ram
3ghz intel
80gb hd
 
9 months ago

indyend
Thank you. It's very useful.  
10 months ago

Wyght
This was excellent, I had no problems at all following you. Thanks  
10 months ago

_dmark
Very Helpful! Thanks!  
10 months ago

mysoomro
You're Most Welcome All. :-)  
10 months ago

laurentperroteau
Perfect !  
11 months ago

jcgd711
Men hello from Colombia and thank you so much!!!

It helped me a lot and now I can build web sites with Joomla in my Linux mint!!!

Thanks again!!! Cheers!!!
 
11 months ago

raughterd
Excellent tutorial. Thanks.  
11 months ago

Cobi
Awsome!!
greate and usefull.
cheers ^^
 
1 year ago

ilham_
Thanks!
It's very helpful :)
 
1 year ago

mega_unknown
Thanks for sharing that great tutorial..it was really staight forward steps
Thanks
 
1 year ago

tlotr
Awesome Tutorial dude. Thank you so much.  
1 year ago

nileshahari
Nice tutorial Keep updating.  
1 year ago

mysoomro
@rickrick2014: It's not possible unless someone hacks your computer. And Linux is quite secure systme so hacking it is not that easy.

@nisan92: I guess @Chet replied to your question very well.
 
1 year ago

mcpacosy
Thank you for this nice tutorial! I created an installation script based on this tutorial that can be used to install the LAMP system in a semi-automatic fashion. I tested the script using a clean Ubuntu Server 12.04 LTS x64 installation as well as a Linux Mint 15 x64 installation. Here it is:

https://github.com/mcpacosy/mint-lamp
 
1 year ago

Thejan
Thanks!! this is a very good tutorial  
1 year ago

Wamukota
Is there a reason that this I would prefere this well documented method v. 'sudo apt-get install tasksel' and select LAMP-server in Tasksel?  
1 year ago

webgift
Thank you @mysoomro for the tutorial. It really help me. I am looking forward how to setup correction virtual host on linux mint 15 mate edition.  
1 year ago

Lipe_San
All good
thanks for the tutorial, pretty straightforward and funcional

now i'll try to put the open ssl libraries to work
 
1 year ago

screamon
All went well untill:
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');
I only could give in my password without the ( )
I could read: bash: syntax error near unexpected token '('
In the PHP.ini I couldn't find a line with ;extension=mysql.so

when I restarted Apache2 I read: could not reliably determine the server's fully qualified domain name, using 127.0.1.1. for servername.
But I had changed that address in my.cnf
I am an new user of LINUX Mint 14 Nadia what did I do wrong?
 
1 year ago

kouros
thanks a lot!!!
 
1 year ago

oxman
Concise, clear and effective. My gratitude to you sir.
 
1 year ago

rmisra1
excellent tutorial ..thanks to document and share same  
1 year ago

turkert
I've fixed some apache packet errors by "apt-get update".
I haven't edited php ini because it didn't exist and the files in etc/php5/apache2/conf.d seems already enabled mysql support.
Phpmyadmin installation also asks for a password. I've given the same password as mysql/root

Well done, good tutorial.
 
1 year ago

Chet
Hi Nisan92,

After you complete the above tutorial, you will now have a new folder called /var/www/. This is where you will put your site. I personally use the LAMP stack to run a local version of Wordpress on my machine.

I install the latest version of Wordpress right in the folder /var/www/.

I can then build the site and test various code changes and plugins "before" I FTP the site up to my web server. I hope this answers your questions.
 
1 year ago

nisan92
I have installed them all, And Now i want to open a site through...
Where i have to keep my pages??
Do i have to do anything else?
 
1 year ago

rickrick2014
I haven't edited any customization files. Can somebody get an access to my server from the Internet? I need the server only for a php programming so i don't want somebody from the internet has the access to my server.  
1 year ago

427008
Thank you. Very usefull  
1 year ago

mysoomro
I'm happy that some of you people found this tutorial helpful. And I'm sorry for the problems or differences that some of you have faced.
I've been busy lately and haven't updated the tutorial..
 
1 year ago

kaizerking
how to install multipl versions of php, or apache, or mysql?
and enable as requird like wamp server addons?
 
1 year ago

cardiffjc
I found this very helpful.
There were a few instances where the tutorial didn't match up exactly with what I saw on my machine, but I was able to work around them.

eg 1 - when I installed MySQL from the command line, it failed ."..unable to fetch some archives...suggest you run (sudo) apt-get update"
The apt-get update seemed to be OK, but the tests later showed that MySQL was not present on my PC. So I took the easy way out and installed from the package manager, which worked with no problems.
eg 2 The tutorial recommends some changes to the phpini file to work with SQL, but my phpini file is not as described. Hope it doesn't matter, or I can fix it.
 
1 year ago

girofleeash
Ho! here is what I get when testing :

Index of /

Name Last modified Size Description
 
1 year ago

girofleeash
This tutorial is great, just found it and can't wait to try reinstalling. I just started and can't get the ''it works!'' page from apache2... I had to restart from scratch and think I might have messed up with some documents perhaps host and hostnames, i don't know what I should do. anyone can help?  
1 year ago

mouton
Thanks for the clear instructions.

I installed Apache2 through webmin; the command line supplied by webmin was:
apt-get -y --force-yes -f install apache2
No password was requested, but the installation went fine since I got "It works!".
How could I make sure that there is a password and that it is not some kind of default password?
 
1 year ago

cckwes
Thank you very much for the guide  
1 year ago

Webbsurfaren
Magic!  
1 year ago

PipoST
Thank you very much. This tutorial saved me a lot of time.  
1 year ago

mysoomro
Thanks for you comments and support.
@burin never heard anything as you said before. naming files as something.php5.
 
1 year ago

ercag
if take permisson(write/read) error than use this

sudo chown -R /var/www
 
1 year ago

Tuomas
Not all worked excatly like u said, but easy to fine the good way.

Thanks for this tutorial.

[Test on Mint Nadia MATE]
 
1 year ago

burin
To my machine I need to name it something.php5 instead of something.php or it won't work.I don't know why.(Mint 14 Cinnemon x64)  
1 year ago

spooge
Excellent instructions - worked like a charm. I also learned that using the command line (apt) is better than using the Software Manger GUI that comes w/ LMDE. I tried it via the GUI first and had problems getting phpMyAdmin installed cleanly (the GUI doesn't prompt for server or phpmyadmin setup). Thanks again!  
1 year ago

mintstar
Thanks! Worked for LM13.  
1 year ago

EmpireITtech
I'm getting this when I try to login: Connection for controluser as defined in your configuration failed.  
1 year ago

EmpireITtech
Using your guide I was able to do almost everything, however I cannot login to the phpMyAdmin page with the user "root"...I've tried to reset the password but it's not doing anything....where should I look to either set that password or turn off the password?  
1 year ago

mysoomro
You're welcome! :)  
1 year ago

almighty000
Thanks a lot for this helpful tutorial.  
1 year ago

jofersu
Thank you, it's really works.  
1 year ago

pablobablo
Thanks!  
1 year ago

mysoomro
Thanks! :)  
1 year ago

JC13
Good one thanks
 
1 year ago

huskeraider
Outstanding!!!  
1 year ago

robins80
The install worked great. However, I'm getting 403 forbidden errors trying to retrieve such things as my style sheets or jquery files. How can I grant access to the var\www directory to my pages, or is there some other directory I can put them?  
1 year ago

mysoomro
@Meshy112: Check my comment on this page addressed to Mark about a year ago..  
1 year ago

Meshy112
Thx. It's very helpful. But how I can comminucate with my ftp-server. Do i need to also install a ftp? Where can i get the data for connection with filezilla to the local-host? Server, username, password, port?  
1 year ago

mysoomro
you're welcome :)  
1 year ago

itsyash
great tutorial man ! seriously..
took me just 10 mins :)
thanks !
 
1 year ago

mysoomro
@artyart: Agreed. There are minor differences. The first time I installed LAMP the prompts were mostly as mentioned above the second time I installed they were slightly different.
But they don't create any big confusion..
 
1 year ago

artyart
Nice job, thanks some of the prompts about passwords and making a new db are a little different in lm13, but the install is very clear and makes this a simple task.
 
1 year ago

mysoomro
You're most welcome @thanh4890, @kyousanzo, @bobbilob and @Hiuhu.. :)  
1 year ago

thanh4890
Thanks, it worked like a charm!  
2 years ago

kyousanzo
thanks for info :D  
2 years ago

bobbilob
I tried to a LAMP stack on Ubuntu with repeated frustration. Tried Mint and followed your tutorial with success!
Linuxmint 13 Maya comes with pluma rather than gedit, so a substitution was needed. Substitution also works for bluefish (my favourite) but generates some error messages.
 
2 years ago

Hiuhu
Oh tnanx it worked  
2 years ago

mysoomro
Where are you saving those .php files??
Make sure to save them in the Root > var > www ...
 
2 years ago

Hiuhu
I followed those instructions & did exactly what you said but now when I try a file with a .php extension it, the browser downloads it instead of loading it what could be the problem ? (thnx)  
2 years ago

mysoomro
You're welcome!!  
2 years ago

htutt
Thanks, very helpful one.  
2 years ago

mysoomro
Sorry for late reply. I couldn't sign in for sometime.
@Harri-P: You're most welcome! :-)
@sapistic: I guess stleon gave you a good help. And for for uploading the files to your website you need to use an ftp(file transfer protocol) client. Use filezilla for it. You can install it with following command in your terminal


sudo apt-get install filezilla


or you can download it from this link:
http://community.linuxmint.com/software/view/filezilla
just click on install. :-)
@stleon: thanks buddy! :-)
 
2 years ago

sapistic
Thanks  
2 years ago

stleon
/var/www by root. or in your home directory(http://community.linuxmint.com/tutorial/view/853)  
2 years ago

sapistic
So I got all this, but now I want to make a website. I have a basic knowledge of web languages, including PHP, but once I have my files, where do I save them so that Apache and PHP have access to them?  
2 years ago

Harri-P
Thank you so much for this! Was brilliant explanation and really clear. I remember trying to do it before and was not looking forward to doing it again but i had done it within 20mins with this! thanks  
2 years ago

mysoomro
you're most welcome stleon...  
2 years ago

stleon
Thank you very much for the wonderful tutorial.  
2 years ago

mysoomro
@gdawn: check these out and see if they're helpful.


http://www.webhostingtalk.com/showthread.php?t=875255


MySQL: Error 1045 (28000): Access denied for user ‘root’@'localhost’ (using password: NO):

 
2 years ago

gdawg
While attempting to install mysql I get the following error:
jane@gdawg-Satellite-C675 ~ $ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I also tried 'sudo mysql -u root' but got same result. Any help will be appreciated.
 
2 years ago

mysoomro
@cahyadwiguna: Check this tutorial. I think you'll find help in it.
http://community.linuxmint.com/tutorial/view/244
 
2 years ago

mysoomro
@minx, Did you changed you httpd-vhosts.conf file?
if you didn't, you need to specify your virtual hosts there, something like following
##
##ServerAdmin postmaster@yourvirtualhost.localhost
##DocumentRoot "/var/www/yourvirtualhost"
##ServerName yourvirtualhost.localhost
##ServerAlias www.yourvirtualhost.localhost
##ErrorLog "logs/yourvirtualhost.localhost-error.log"
##CustomLog "logs/yourvirtualhost.localhost-access.log" combined
##


You can find location of httpd-vhosts.conf file from httd.conf it is normally in apache/conf/extra.
 
2 years ago

minx
Hello,
How to use virtual hosts in Apache? I followed a tutorial of ubuntu and i have activated vhost_alias module but it does not work.
 
2 years ago

nicolx
I think is important fix this on apache restart:
Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
Is just a warning but i hate see them! :P
To solve it, open /etc/apache2/site-avaiable/default and att at top of file ServerName localhost.
If you like it add this tips in this article!
 
2 years ago

cahyadwiguna
how to make virtual directory or /var/www in home?
how to make change permission?
 
2 years ago

slotzero
Great write up - thanks!  
2 years ago

mysoomro
Hey mk_hayes and the64u.. I'll look into other question and comments later on. But mk_hayes you're right for

<?php phpinfo(); ?>
not
<!--?php phpinfo(); ?-->

But I noticed this error long ago and corrected it twice.. If you look at the older comments you'll find out.. But I don't know why it's changing again and again. I think some other codes are messing up with the codes in this tutorial..

Sorry for inconvenience.
 
2 years ago

mk_hayes
Thanks for this tutorial as it's a great start but it needs a few additions.

Yeah, Test PHP instructions are still, or perhaps again screwy.

sudo gedit /var/www/testphp.php opens up a file called testphp.php, not phptest.php as you have written. And the file needs to contain this:

<?php phpinfo(); ?>

not this:

<!--?php phpinfo(); ?-->

And for those looking for ;extension=mysql.so in php.ini
search for this without the ; as it is spaced well apart from the rest and you'll be able to find and uncomment it. (Which is what removing the semicolon does.)

I needed manuka's comment to get phpmyadmin to work. Also, while it may seem obvious, phpmyadmin login is root plus the password created during the mysql install.
 
2 years ago

the64u
hi,

i work on LAMP last 3 Days.
I m working Linux Mint Katya 32bit
i also tries Mint community, ther Mr Collin helped me..

I want create DB for Drupal

But face probelem in log in of localhots/phpmyadmin
error : #1045 Cannot log in to the MySQL server

when i found i completely remove the mysql-server, PHP5,Apache2
and then follow the instruction given by u.
Start was ok,but the commend does not show any thing
http://localhost/testphp.php
After that there is no content for ;extension=mysql.so

i still finding another solution..


Help me to sort out..




 
2 years ago

QianQinD
Thanks for the very helpful article:)  
2 years ago

mysoomro
you're most welcome. :-)  
2 years ago

zaenal1234
Thank's for this tutorial...& very useful&helpful;.  
2 years ago

zibams
thanks so much bro this is really awesome  
2 years ago

mysoomro
Dear Bob,
You're most welcome. I'm glad that this tutorial is assisting the Linuxmint community.

Regards,
Younis
 
2 years ago

mysoomro
Dear Mark,

Try using SCP Client for Mac
Transmit http://www.panic.com/transmit/
or filezilla or cyberduck.

If you want to setup FTP following link might help you in this regard.
http://community.linuxmint.com/software/view/vsftpd
https://security.appspot.com/vsftpd.html
http://www.unixmen.com/linux-tutorials/475-insall-vsftpd-in-ubuntu-
 
2 years ago

macgraphic
Thanks mysoomro, that got it all set up nicely on Mint.

Got a question though, how can I set up FTP accounts within Mint/LAMP to allow access (uploading of files {plugins etc for the wordpress sites on there} for use on them - I also have this installed on a local PC, but do my site coding in Dreamweaver on a mac (on same local network).

Thank again. Mark
 
2 years ago

guruwannabe
Hi,
Thanks a lot.
Just managed to install Apache, MySQL and PHP following your tutorial.
Regards,
Bob
 
3 years ago

manuka
This is a step a lot of LAMP tuts miss, if you are getting a 404 error after finishing all the install steps for http://localhost/phpmyadmin then do the following:

Type the following command to open up your apache2.conf file:
gksudo 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

Done. I can't claim credit for this and is documented on a few LAMP installs round the place
 
3 years ago

ilucmaster
How to install pear-php, i bought a bock named Beginning PHP 5 and MySQL E-Commerce  
3 years ago

prativasic
Thanks for this wonderful tutorial. Although I use Xampp for it. But for my 64bit PC, I think it's the best way.
And dear Gurman, you can try installing Xampp for Linux which is a package containing the same and requires less command line.
 
3 years ago

mysoomro
Dear Gurman! try using these terminal commands you'll see if it's more complex or really fast, easy and convenient. With just one command, it'll locate the site of the application on web, download it for you, and Install it.. All in one go.. What can me more easy and convenient than this.. And I don't agree with you.. Web page developers and designers do need to code a lot.. May be only graphical part doesn't need coding but all other stuff needs a lot of code. PHP, MySQL, CSS, HTML, XHTML, XML, ASP.NET, JavaScript, all are code based technologies.. Though you can use GUI phpmyadmin for MySQL, but all other still need codings.  
3 years ago

Gurman
"If you're a webpage designer or developer..."
If I am a webpage designer or developer I do not want to understand the complexities of command line. I need a modern graphical interface for fast and convenient installation and configuration.The designer should be able to do the design but not programming shell. imho.
 
3 years ago

Elisa
IMO, for silly noobs aka beginners it's better instead Apache, use rather other web server, a nice GUI configured one -> 'Cherokee' :D or another powerful one - 'lighttpd' ;)
Think about that :P
 
3 years ago

Fiffifips
Thanx to trollboy and thanx to mysoomro ! working with terminal is fun . and always don't panik! things go on . I think it did well. and I will go on with this stuff working, thanx. My Homepage is waiting ....  
3 years ago

mysoomro
Got it right. :). I think the websites code was messing up with the code of tutorial.  
3 years ago

mysoomro
Thank you. and yes, you're 100% right. It's <?php phpinfo(); ?>. But I think there is some problem. When I went to edit this, this entire field of code was empty. And I had checked each code before uploading the tutorial.
Let me try it again.
 
3 years ago

trollboy
Good tutorial but Test PHP step 2 is wrong

It should read
<?php phpinfo(); ?>

instead of
<!--?php phpinfo(); ?-->

 

Other tutorials from mysoomro