Instalasi PHP 5 Apache2 MySql di Komputer Ubuntu


Berikut adalah langkah-langkah instalasi LAMP di Ubuntu

  1. jalankan perintah berikut dahulu
    1. sudo apt-get update
    2. sudo apt-get upgrade
  2. Install web server apache2
    1. sudo apt-get install apache2
  3. INstall database MySQL Server
    1. sudo apt-get install mysql-server
    2. mysql_secure_installation
  4. Install PHP 5
    1. apt-get install php5 php-pear
  5. Install Mcrypt
    1. sudo apt-get install php5-mcrypt
  6. Install Debugger yaitu XDebug untuk PHP5 dan Ubuntu
      • sudo apt-get install php5-xdebug
      • cek xdebug dengan ketik " php --version" bila terinstall akan muncul :
        • PHP 5.5.9-1ubuntu4.9 (cli) (built: Apr 17 2015 11:44:57)
          Copyright (c) 1997-2014 The PHP Group
          Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
          with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
          with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

        • Mari konfigure xdebugnya
          • sudo vi /etc/php5/apache2/php.ini
          • tambahkan lines berikut diakhir file php.ini
            zend_extension="/usr/lib/php5/20121212/xdebug.so"
            xdebug.remote_enable=1
            xdebug.remote_handler=dbgp 
            xdebug.remote_mode=req
            xdebug.remote_host=127.0.0.1 
            xdebug.remote_port=9000
            xdebug.max_nesting_level=300
          • restart apache dengan “sudo service apache2 restart”
          • buat file “sudo vi /var/www/html/test.php” lalu isi dengan :
            • <?php
              phpinfo();
              ?>
            • open browser and go to http://localhost/test.php

do not forget pake sudo ya… biar ga error :

E: Could not open lock file /var/lib/dpkg/lock – open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s