April 13, 2010 by  

[HowTo] Install Apache, PHP, MySQL, and PHPMyAdmin on Ubuntu

After a while i haven’t write on my blog. Now i’m ready to start writing again. Probably you notice that i changed my theme. Yes i was busy redesign my theme from the start. Anyway i will tell you the story on the next article.

Now i want to show you how to install Ubuntu Karmic Koala 9.10 as a perfect server with Apache, PHP, MySql and Phpmyadmin. Since Ubuntu have a great repositories and the magic application called apt-get then it shouldn’t be hard to make Ubuntu as a perfect server.

Okay let’s begin, please make sure your Ubuntu conneted to the internet:
1. Open your terminal and login as root with this command

su

2. Update your repositories list:

apt-get update

3. Install Apache:

apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils

4. Install PHP:

apt-get install php5 libapache2-mod-php5 php5-common php5-gd php5-mysql php5-imap php5-cli php5-cgi php-pear php-auth

5. Install MySQL:

apt-get install mysql-server mysql-client

here you will be ask to input root password for the mysql
6. Install PhpMyAdmin:

apt-get install phpmyadmin

here you will be asked some question to configure the phpmyadmin, just go through the wizard after it finish installed.
7. Now your server is ready. Before you test please make sure to restart the server:

/etc/init.d/mysql restart
/etc/init.d/apache2 restart

8. Open document root in /var/www , make a file called it with info.php
and fill this:

<?php phpinfo(); ?>

then save the file.
9. Test the server with the browser and type address http://[server-ip]/info.php
If you have the same screenshot as follow than you have the web server on your machine:

PHP Info

PHP Info Mysql

That’s it for now. Thank you for visiting my blog. I hope you enjoy. Have a nice day…

Ivan

What people search:

Post comment as twitter logo facebook logo
Sort: Newest | Oldest
selvamgowri.s 5 pts

etc/init.d/apache2 restart * Restarting web server apache2 (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action 'start' failed. The Apache error log may have more information. [fail]

hi ivan

i am getting the above things when i restart my apache

how to get rid of it?????????????/

<script>alert('hey')</scripy>

pake ubuntu 10.10
$ su ganti pake $ sudo baru bisa jalan..
maksih mas

U great work

thanks for your instruction :)

very helpful...thank you :)

Just a question:
When you do apt-get install mysql-server, which version is the installation?

You can find the package description with this command:
apt-cache show mysql-server

THanks a lot it works. Now I have to figure out how to install perl and postgresSQL and to be able to view it on the browsor. Any suggestions?

http://www.ivankristianto.com/os/ubuntu/howto-make-apache-user-directory-on-ubuntu/1019/

Hello !
In /var/html the php is good.
But in my home directory the php is fail
I like to create phps in my home.
http://localhost/~lula

Superb information....really learnt a lot...

Hi Ivan,
I am php deverloper from india. I like your article. It is greate helps me.
I am facing one problem Please help me.
I want to run mysql queries on ubuntu 10.10 terminal.
i had given following commands but can't works

root@arreys-24:/etc/init.d# cd mysql
bash: cd: mysql: No such file or directory
root@arreys-24:/etc/init.d# mysql start
The program 'mysql' can be found in the following packages:
* mysql-client-5.0
* mysql-client-5.1
Try: apt-get install <selected package>
bash: mysql: command not found
root@arreys-24:/etc/init.d# apt-get install mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package mysql
root@arreys-24:/etc/init.d# cd ..
root@arreys-24:/etc# cd..
bash: cd..: command not found
root@arreys-24:/etc# cd ..
root@arreys-24:/# /etc/init.d/mysql start
bash: /etc/init.d/mysql: No such file or directory

Please help me.

try find mysql with:
apt-cache search mysql
then find the correct name. and install it.

use tab when writing your command, so after you write 3 char and tab to auto completion.

Hey Ivan,
Thanks. Actually i am new on ubuntu 10.10 Operating system.
Great helpful for me and it is working.

Once again thank you so much.

i will write it in the next article..

para acceder a http://localhost/phpmyadmin/
se debe ejecutar:
sudo ln -s /usr/share/phpmyadmin /var/www/

fuente: http://www.guia-ubuntu.org/index.php?title=PhpMyAdmin

Thanks, it's works well

thank sir! will be my first touch on linux ub10

Good job!
I have been search it for a long time so you've helped me!
Thanks a lot!

Thank you, Ivan, for this good and simple post for Linux newbie (and Win oldfag).

mantap nih om, keep posting, tengkyu om. :)

Login/Register script using PHP and MySQL
The following example expalins the creation of simple login and registration page using PHP and MySQL.
http://apachetechnology.net/KC/swphpLogin.aspx

I tried to install ubuntu-8.04.4-server-amd64. I have problem with perl.
When I run my php script which contain perl, there is error : "Fatal error: Class 'Perl' not found in ................."
I have installed this : libapache2-mod-perl2 , perl-base , perl-modules
I check in php -m , cannot find perl
What should I do ? Thanks in advanced.

BTW, do you come from country code .id ? :)

instructions for Debian/Ubuntu Linux

http://www.geeksww.com/tutorials/database_management_systems/mysql/installation/downloading_compiling_and_installing_mysql_server_from_source_code.php

Trackbacks

  1. [...] For install Apache, MySQL, PHP and PHPmyadmin for testing evironment, please refer to this post. [...]