Persiapan Pemrograman PHP di Linux
81 / 100

6 Tools to prepare for Learning PHP Web Programming on Linux

6 Tools to prepare for Learning Web Programming (PHP) on Linux. What are the applications needed for web programming on Linux?

Advertisements

The answer: depending on the language to be used.

Usually the language commonly used is PHP.

Apart from PHP, we also use Python, Java, Ruby, C#, etc.

At this writing, we will use PHP…

For other languages, please read here:

Then for the tools we need for PHP programming on Linux are as follows::

1. Text Editor

We will use the text editor to write the code.

There are many text editor options in Linux such as: Gedit, Geany, Atom, Sublime, CodeLite, etc.

Choose the text editor you like.

I myself using VS Code, because it is quite complete and easy to use.

Teks editor VS Code untuk menulis kode PHP

(read too: 6 Text Based Text Editor (CLI) on Linux to Write Code)

2. Browser

We must install this program, because we will use it to see the results of the written web code.

There are many browser options on Linux: Google Chrome, Firefox, Opera, etc.

Choose the browser you like.

Browser Mozilla Firefox di Linux Mint

3. PHP

So that PHP code can be executed, we need a PHP interpreter. The interpreter is in charge of translating PHP code to be understood by the computer.

There are two versions of PHP currently in circulation: PHP 5.x and PHP 7.x

Which version should I install?

I recommend installing the latest one, that is PHP 7.x. Because PHP 5.x is about to end its support period.

Masa dukungan PHP

On Ubuntu 16.04 and Linux Mint 18.2, PHP 7 can already be installed with the command:

sudo apt install php

Then, type y to continue:

Install PHP 7 di Linux

After that, don't forget to install common libraries that are often needed.

sudo apt install libapache2-mod-php php-mysql php-common

Information:

  • package libapache2-mod-php required by apache2 server;
  • package php-common contains some frequently needed libraries;
  • package php-mysql needed for PHP connection with MySQL.

After that, to make sure PHP is installed correctly. Try typing the command php -v:

4. Server Web (Apache)

In fact PHP has brought its own web server, so Apache doesn't actually need to be installed.

But, because we want to use PHPMyAdmin, then we have to install it.

Please type the following command to install apache server on Linux:

sudo apt install apache2

After that, try to check installed version with command apache2 -v.

Versi Apache yang terinstall

Then how to operate this Apache server?

If using XAMPP, we just click start, then the apache2 service will run.

Nah, if on Linux, we can use this command to start the apache service:

sudo service apache2 start

Command to stop apache server:

sudo service apache2 stop

Command to restart:

sudo service apache2 restart

Command to view server status:

sudo service apache2 status

other than that, we can also open the address http://localhost

to check whether the apache server is running or not.

If it looks like the following, then the server is running.

Ujicoba server apache melalui browser

Don't forget to set the server directory permissions too, so that ordinary users are free to create files and directories there.

sudo chmod 777 /var/www/html -R

5. Server Database (MySQL)

When we will make more complex applications, we need a database to store the data.

Usually, The database used is MySQL. Besides MySQL, there is also PostgreSQL, Mongodb, SQLite, etc.

We will use MySQL only.

Please type the following command to install MySQL on Linux.

sudo apt install mysql-server

Type y to continue:

Install MySQL

In the installation process, we will be asked for the password for the root user in MySQL.

Please enter a password that is easy to remember (example: kopi).

Membuat password root mysql

Enter the password again:

Konfirmasi Password

Installation complete.

Don't forget to also check the MySQL version installed with the command mysql --version.

Periksa versi mysql yang terinstall

How to operate it is the same as running the apache service.

sudo service mysql start # menayakan service
sudo service mysql stop # menghentikan service
sudo service mysql restart # menyalakan ulang service
sudo service mysql status # melihat status server

6. PHPMyAdmin

PHPMyAdmin will be used to easily manage MySQL databases. Because it has a web-based GUI interface.

Apart from using PHPMyAdmin, we can also use other applications such as MySQL Workbench, Navicat, etc.

Please type the following command to install PHPMyAdmin on Linux:

sudo apt install phpmyadmin

Type y to continue:

Install PHPmyadmin di Linux

In the installation process we will be asked to specify the server type and password for root.

Advertisements

Source : https://www.petanikode.com/pemrograman-web-di-linux/

Advertisements

 708 total views,  4 views today

By admin

Writer

Leave a Reply

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

5 × one =

Web Hosting Murah Yang Terbaik Di Indonesia