localhost (apache php mysql and phpmyadmin)

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
Post Reply
Milutin
Level 1
Level 1
Posts: 26
Joined: Thu Feb 05, 2009 5:22 pm

localhost (apache php mysql and phpmyadmin)

Post by Milutin »

Could somone write the tutorial on how to set the localhost server on personal computers,

I am new user of linux in general till now in windows I was using the program appserv that installed all this on one click!

I understand that this is not the way how the linux is operating and I am fine with it
However I am bagging somone to write the tutorial how to do this?

it is for web development and testing purposes!
Last edited by Milutin on Thu Feb 12, 2009 9:46 am, edited 1 time in total.
Husse
Level 23
Level 23
Posts: 18677
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: localhost (apache.php. mysql and phpmyadmin)

Post by Husse »

I do not have the time to write tutorials any more - perhaps now when the new forum works :)
Google for lamp ubuntu desktop and you will have a bunch of turorials
lamp = linux apache mysql php
Most solutions that work for Ubuntu works for Mint - the opposite is not quite true
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Milutin
Level 1
Level 1
Posts: 26
Joined: Thu Feb 05, 2009 5:22 pm

Re: localhost (apache.php. mysql and phpmyadmin)

Post by Milutin »

Ok I have found somthing (I hope that this is it) so if eny one can confirm it ?

For the rest tu use it!

LAMP

Code: Select all

 
sudo apt-get install apache2 
sudo apt-get install php5 libapache2-mod-php5 
sudo /etc/init.d/apache2 restart 
sudo apt-get install mysql-server 
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin 
sudo /etc/init.d/apache2 restart 
sudo a2enmod rewrite 
sudo /etc/init.d/apache2 restart 


During the instalation of MySql it will ask for the password of root user.

After these 8 steps we have LAMP installed with the suport for mod_rewrite. in order the mod_rewrite to be functional we need:

Code: Select all

sudo gvim /etc/apache2/sites-available/default


Finde line:

Code: Select all

 AllowOverride None 
and comment it as:

Code: Select all

 AllowOverride All 
. AllowOverride directive sets if Apache takes in consideration .htaccess files or just to ignore them.
After this another time:

Code: Select all

 sudo /etc/init.d/apache2 restart 
in order for Apache to work withthe changes we have made.

For phpMyAdmin yet, type the following line in the Terminal:

Code: Select all

apt-get install phpmyadmin
To set up under Apache 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:

Code: Select all

gksudo gedit /etc/apache2/apache2.conf
Add the following line of code inside apache2.conf:

Code: Select all

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf
Include /etc/phpmyadmin/apache.conf
Now restart Apache:
sudo /etc/init.d/apache2 restart


Than test by

Na http://localhost/ it should state"It works!".
http://localhost/phpmyadmin will open phpmyadmin




I will test this during the weekend! (tested and operational! 8) )
metalistas2
Level 1
Level 1
Posts: 1
Joined: Sun Feb 14, 2010 8:40 am

Re: localhost (apache php mysql and phpmyadmin)

Post by metalistas2 »

I have problem :
I entering this line :
sudo apt-get install mysql-server
Then Terminal asking password . But when I wringting password , terminam writing nothing . :?




Sorry Bed English.
Ninyx
Level 1
Level 1
Posts: 12
Joined: Fri Feb 12, 2010 1:30 am

Re: localhost (apache php mysql and phpmyadmin)

Post by Ninyx »

That is what its supposed to do, its a sort of security feature.
Don't worry its getting it! :-D
Just type it all correctly and press enter
MikeWS
Level 1
Level 1
Posts: 3
Joined: Thu Feb 18, 2010 1:37 pm

Re: localhost (apache php mysql and phpmyadmin)

Post by MikeWS »

Hello All,
New to Mint and this forum but not to Linux.
I would recommend installing XAMPP from http://www.apachefriends.org/en/xampp-linux.html. It is a complete LAMP stack plus extras which runs separately from the OS processes.
Follow the fairly simple instructions on that page. It really is straightforward.
I use it on an Acer netbook without problems.
Note that it does not include any software for coding.

Mike
Acer Aspire One 8GB SSD running latest Linux Mint Fluxbox CE.
New to Mint but not to Linux.
User avatar
rich_roast
Level 6
Level 6
Posts: 1123
Joined: Sat Sep 05, 2009 4:37 pm

Re: localhost (apache php mysql and phpmyadmin)

Post by rich_roast »

I was about to write a quicky tutorial on this myself, having not seen the OP, but will just to add to this thread now.

I only just happened to need an apache/php testing environment and so I just installed apache and php and the php modules I needed via synaptic. Followed this with

Code: Select all

sudo /etc/init.d/apache2 restart
and then created a php test file in /var/www, just <?php phpinfo(); ?>, and pointed firefox to it: localhost/test.php.

Works like a charm.

That's real quick; you'll want to set up admin stuff and MySQL too, and I recommend this tutorial here which I pretty much used.
User avatar
Chrisisaturtle
Level 1
Level 1
Posts: 4
Joined: Mon Feb 22, 2010 2:36 pm

Re: localhost (apache php mysql and phpmyadmin)

Post by Chrisisaturtle »

Interesting, perhaps very useful for newbies to Linux who've converted from Windows.
Image

From Windows I lept,
to Linux I fell.
davethomas11
Level 1
Level 1
Posts: 8
Joined: Tue Feb 08, 2011 7:27 pm

Re: localhost (apache php mysql and phpmyadmin)

Post by davethomas11 »

I did everything in milutin's post above,

Now everything is working as it should

But one probelm when I use fopen fwrite commands in php, I can't write files because of a permission error

Is there are way to give PHP and/or apache file writing access to /var/www ?

**edit problem solved** !im new so please let me know if there are issues with what I did to make it work

I edited apaches configuration files to move my www folder to my home, and made apache's run user me

sudo gedit /etc/apache2/envvars
- in the above file change APACHE_RUN_USER (and group) to you

moving www folder
sudo gedit /etc/apache2/sites-enabled/000-default
- in the above file change all var/www to home/dave/www (home/you/whereeveryouwanttoputthem)
coopertronic
Level 1
Level 1
Posts: 4
Joined: Thu Feb 17, 2011 2:25 pm

Re: localhost (apache php mysql and phpmyadmin)

Post by coopertronic »

Hello.

I've set up everything but I have one problem. I can't login to the PHP server through the web interface. The username is the bit I'm stuck at. I don't remember having to assign a username for it. The password is fine. Is there a default username of do I have to set in the scripts .conf stuff? I tried my mint username I use in console terminal but no luck.

What am I doing wrong? What am I missing? (a brain maybe?) <<--Joke~

I expect it's something simple I've overlooked.

Thanks ;)
terrorblader
Level 3
Level 3
Posts: 114
Joined: Fri Oct 24, 2008 4:08 pm
Location: Romania

Re: localhost (apache php mysql and phpmyadmin)

Post by terrorblader »

I believe you are refering to http://localhost/phpmyadmin/ , the username for that is

Code: Select all

root
and the password is whatever you typed in during the setup.
User avatar
DataMan
Level 6
Level 6
Posts: 1234
Joined: Thu Dec 04, 2008 6:47 am
Location: Carmel, Midwest USA at /var/www
Contact:

Re: localhost (apache php mysql and phpmyadmin)

Post by DataMan »

I can't login to the PHP server through the web interface.
Correct terminology... in a LAMP installation, you are running an Apache web server with a MySQL database server running under Apache. PHP is not a server.

PHPMyAdmin is an application running within your Apache webserver

:)

-DataMan
Linux'd since 2005 Linux ID 422356 Ubuntu ID 15015
oc999
Level 1
Level 1
Posts: 27
Joined: Sat Feb 13, 2010 6:52 am

Re: localhost (apache php mysql and phpmyadmin)

Post by oc999 »

hey,

I could also need some help setting up apache2, mysql & php.
Installation went fine - the only problem I have is with opening php-files - if i try to open them in my browser (firefox) it will just offer me a download instead of displaying it.
I have a directory (/var/www/wordpress - with wordpress extraded there) - and want to get to configure wordpress (which should be easy by opening the install.php file).
I have found several useful tutorials online - many also regarding that problem with php-files but nothing worked so far.
What I have done so far:
checked if the module is loaded (php5) - yes.
restarted the server after applying changes - yes.

Later I read something about the httpd.conf file - it seems to be important for anything in apache2 but mine was completely empty.
After some research I added some minimal configuration - Listen 80 and DocumentRoot "/var/www" but when I tried to restart I would tell me the adress is already in use - so I deleted the Listen 80 and DocumentRoot lines off it again and only left one line which supposedly would fix the php file error:
"AddType application/x-httpd-php .php" - still without any effect.

I dont know if i shouldve opened up a new thread for that but I wouldnt have known what category it is anyways :)

Well I hope somebody can help me out here!
Thanks in advance!
Samricky
Level 1
Level 1
Posts: 2
Joined: Mon May 16, 2011 8:32 pm

Re: localhost (apache php mysql and phpmyadmin)

Post by Samricky »

As an alternative, you might want to check out the (also free) approach offered here: http://www.apachefriends.org/en/index.html . With more details available here: http://www.apachefriends.org/en/xampp-linux.html and here http://www.apachefriends.org/f/viewforum.php?f=17 . I've used the Apache Friends approach successfully on both Windows and Linux systems. :D
Post Reply

Return to “Tutorials”