Blog for Learning

| lesson material | material summary | questions and answers | definitions | types and examples | other information | materi pelajaran | ringkasan materi | pertanyaan dan jawaban | definisi | jenis-jenis dan contoh-contoh | informasi lainnya |

Powered by Blogger.

Pages

Web Programming on Linux with XAMPP

Php Xampp
Many use XAMPP to learn web programming, both on Windows, Linux, and MacOS.
But I actually prefer to use a server installed from a separate package , because it feels like assembling a real server.
Just install:
apt install apache2 mysql-server php libapache2-mod-php php-mcrypt php-mysql phpmyadmmin
Sounds more complicated indeed, but it will add to our insight into server configuration.
For those who don't want to bother, you can use XAMPP.

What is XAMPP?

XAMPP is an application package which contains web server, PHP, MySQL, Phpmyadmin, perl, curl, and other programs to support web development.
XAMPP can now be used on Windows, Linux, and Mac.

Download and Install XAMPP

We can download XAMPP from the official website: Download XAMPP .
Download XAMPP
Choose PHP 7, because PHP 5 will soon be extinct. ðŸ˜„
PHP Support
After the download is complete, we will get a binary file.
PHP Support
We will execute this file with the user rootTherefore, let's open the file manager as rootThen, click 2x on the file.
Then a window will appear like this.
PHP Support
Click next to continue.
We will be asked to determine which components will be installed. Leave it like this:
PHP Support
Then click next .
XAMP will be installed in the directory /opt/lampp/, click next to continue.
PHP Support
Click next again.
PHP Support
Once again, click next to start the installation ...
PHP Support
... and wait until the process is complete
PHP Support
Click finish to end and open XAMPP.
PHP Support

Operate XAMPP

Now try going to the Manage Servers tab , then turning on the Apache web server service by clicking the start button .
PHP Support
Next, try to open the browser and open the http: // localhost / address , it will look like this.
PHP Support
Congratulations ðŸŽ‰Webserver is going well.
Anyway, in some distributions, XAMPP is not on the menu. To reopen XAMPP, we must execute the file /opt/lampp/manager-linux-x64.runas root.
XAMPP Manager

Get to know the htdocs directory

Directories /opt/lampp/htdocsare directories where we put web files likehtmland phpThis file will later be accessed via the http: // localhost / address .
For example:
We put the file /opt/lampp/htdocs/webku.php, then how to open it in the browser is with the address http: //localhost/webku.php .
However, for now, it's only rootpossible to write files there. So that all users can write there, we must give access rights.
Type the following command in the terminal to give access rights to write files to all users.
sudo chmod 777 /opt/lampp/htdocs/ -R
Now let's make a file called hello.php.
Hello PHP
Then try opening the browser: http: //localhost/hello.php
PHP Hello World
Congratulations ðŸŽ‰this is the first PHP program that we created in XAMPP.

Lack of XAMPP

There are some disadvantages that I feel at XAMPP:
  • Cannot open interactive php .
  • Commands phpand are mysqlnot recognized in the terminal, because they have not been added to the environment variable .
  • If you want to open Xampp, you have to open the directory /opt/lamppfirst, unless the shortcut is created.
  • XAMPP on Linux is not directly integrated with menus such as Windows and Mac.


0 Komentar untuk "Web Programming on Linux with XAMPP"

Silahkan berkomentar sesuai artikel

 
Template By Kunci Dunia
Back To Top