Installing LAMP di Linux Mint 18

Posted on

Pada Kali ini saya akan menjelaskan cara instalasi di linux mint 18 :


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.

In this part we will install PHP 7.
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 php7 libapache2-mod-php7
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

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 Copy/paste or type the following line into Terminal:
sudo apt-get install libapache2-mod-auth-mysql php7-mysql phpmyadmin
After that is installed our next task is to get PHP to work with MySQL

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

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/html/<your-directory>/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!


Referensi : https://community.linuxmint.com/tutorial/view/486
Gravatar Image
Suka jalan-jalan, naik sepeda, bermain code-code asal tidak suka mengkode cinta. Hubungi email : andhika.na@gmail.com jika anda butuh website untuk personal maupun bisnis.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.