Search this site

Sunday, January 26, 2014

Installing apache, PHP5, and MySQL in ubuntu

Well, this blog will be my own note for something like this.
I hope this also help someone who still don't know how to install it.

Step:
1. sudo su (must be root)
2. Installing MySQL

  • apt-get install mysql-server mysql-client
  • To check: type mysql in terminal

3. Installing Apache2

  • apt-get install apache2
  • To check: go to your browser and open your IP for example localhost (if you using xampp) or http://192.168.0.100 
  • Apache's default document root is /var/www on Ubuntu, and the configuration file is /etc/apache2/apache2.conf. Additional configurations are stored in subdirectories of the/etc/apache2 directory such as /etc/apache2/mods-enabled (for Apache modules), /etc/apache2/sites-enabled (for virtual hosts), and /etc/apache2/conf.d. 

4. Installing PHP5

  • apt-get install php5 libapache2-mod-php5
  • After that restart apache
  • /etc/init.d/apache2 restart 
  • To check: go to /var/www and make info.php like this

phpinfo();
?>

  •  And open it with your browser IP/info.php or http://192.168.0.100/info.php

5. MySQL support PHP5

  • we need MySQL for PHP5 support
  • apt-cache search php5
  • pick anything you need
  • apt-get install php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
  • After that restart apache again
  • /etc/init.d/apache2 restart
  • To check: reopen info.php and it will show some new module

6. Install phpmyadmin

  • to help us to manage mysql
  • apt-get install phpmyadmin
  • To check: go to your browser, open your IP/phpmyadmin or http://192.168.0.100/phpmyadmin

Source: link

No comments:

Post a Comment