Instructions for installing LAMP on Ubuntu for beginners
In this article, we will show you how to install a LAMP system. LAMP includes Linux, Apache, MySQL, PHP. This tutorial is primarily for people who have only a little knowledge of Linux use.
In this article, we will show you how to install a LAMP system.LAMP includes L inux, A pache, M ySQL, P HP. This tutorial is primarily for people who have only a little knowledge of Linux use.
Install Apache
To get started we will guide installing Apache.
1. Open the Terminal section ( Applications > Accessories > Terminal )
2. Copy / Paste the following line of code into Terminal and press enter:
sudo apt-get install apache2
3. Terminal will ask for your password, enter it and press enter.
Check Apache
To make sure everything is installed correctly, we will proceed to check Apache to make sure it works properly.
1. Open the browser and then enter the following web address in the address box:
http:/// localhost /
2. You will see a folder named apache2-default /. Open that folder, you will get a message saying ' It works! 'and you succeeded.
Install PHP
Next we will proceed to install PHP 5.
Step 1: Re-open the Terminal section ( Applications > Accessories > Terminal )
Step 2: Copy / Paste the following command line into Terminal and press enter:
sudo apt-get install php5 libapache2-mod-php5
Step 3: Valid for PHP to work and compatible with Apache and we must restart it. Enter the following statement in Terminal to do this:
sudo /etc/init.d/apache2 restart
Check PHP again
To make sure there are no problems with PHP, check it out using the following steps:
Step 1: In Terminal, copy and paste the following command and press enter:
sudo gedit /var/www/testphp.php
This command will open a file named phptest.php .
Step 2: Copy / Paste the following command line into the phptest file:
Step 3: Save and close the file
Step 4: Open your web browser and enter the following address:
http:///localhost/testphp.php
You will see the following interface:
The installation of both Apache and PHP has been successful!
Install MySQL
Finally, installing MySQL
Step 1: Again open Terminal and enter the following command:
sudo apt-get install mysql-server
Step 2 (optional): For other computers on the network to see the server you created, you must first edit the 'Bind Address'. Start by opening Terminal to edit the file my.cnf .
gksudo gedit /etc/mysql/my.cnf
At the line
bind-address = 127.0.0.1
Change 127.0.0.1 address to your IP address
Step 3: This is an important step, enter the following command into Terminal:
mysql -u root
And copy / paste the following command:
mysql> SET PASSWORD FOR 'root' @ 'localhost' = PASSWORD ('yourpassword');
(Please change yourpassword with the password you choose)
Step 4: Now we will proceed to install phpMyAdmin, this is a simple tool to edit your database. Copy / paste the following command line into Terminal:
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin
After installing everything, the next step is to make PHP work with MySQL. To do this, we need to open the php.ini file by entering the following command:
gksudo gedit /etc/php5/apache2/php.ini
In this file, we need to remove the comment in the following line by removing the first semicolon ( ; ):
; extension = mysql.so
Change it to the following:
extension = mysql.so
Now you can restart Apache and complete the entire installation process!
sudo /etc/init.d/apache2 restart
You should read it
- Cách để Xóa chương trình bổ sung trên PS4
- Should buy a bathroom heating lamp of the best company?
- What's New in Ubuntu 21.10?
- Does the bathroom heating lamp cost electricity?
- Entertainment with Akinator application, the god of lights can read your thoughts
- Top best bathroom heating lamps today
- Instructions for installing bath heating lamps and safe usage
- Xiaomi launched the MIJIA Desk Lamp Lite desk lamp for only $ 11
- Instructions for installing Ubuntu Web Server on remote host
- Why is Ubuntu LTS preferred over regular distros?
- What's new in Ubuntu 18.04 LTS just released?
- 7 Bathroom lamps with less than 1 million VND worth to buy
Maybe you are interested
5 free AI chatbots for your website How to use Canva's Magic Studio to edit designs Top 10 Good Games for You to Fight with Ancient Dragons How to play music when the laptop screen is folded Avoid These Mistakes When Playing Situs Judi QQ Online Indonesia President Trump: 'I'm not a fan of Bitcoin or any other electronic money'