Installing LAMP On Linux Mint

Installing LAMP (Linux, apache, MySQL and PHP) On Linux Mint.

LAMP stands for Linux, Apache, MySQL, PHP. How to install Linux the L of LAMP.

Install Apache

To start off we will install Apache.

1) Open up the terminal

(APPLICATIONS > ACCESSORIES > TERMINAL)

2) Copy/Paste the following line of code into Terminal and then press enter

SUDO APT-GET INSTALL APACHE2

3) Type you’re password, and then press enter.

The page should display the words

.

.

.

.

“It works!”

Testing Apache

To make sure everything installed correctly we will now test Apache to ensure it is working properly.

1) Open up any web browser and then enter the following line.

HTTP://LOCALHOST/

2) You should see a folder entitled apache2-default/.

3) Open it and you will see a message saying

.
.
.
.
“It works!”, congrats to you!

Install PHP

PHP is an open source web scripting language that is widely use to build dynamic webpages.

To install PHP

1) Open up the Terminal

(APPLICATIONS > ACCESSORIES > TERMINAL)

2) Type in this command

SUDO APT-GET INSTALL PHP5 LIBAPACHE2-MOD-PHP5

After you answer yes to the prompt twice, PHP will install itself.

3) It may also be useful to add php to the directory index, to serve the relevant php index files

SUDO NANO /ETC/APACHE2/MODS-ENABLED/DIR.CONF

Test PHP

To ensure there are no issues with PHP let’s give it a quick test run.

1) Open up the Terminal

(APPLICATIONS > ACCESSORIES > TERMINAL)

2) Type in this command

SUDO GEDIT /VAR/WWW/TESTPHP.PHP

This will open up a file called phptest.php.

3) Copy/Paste this line into the phptest file:

<?PHP PHPINFO(); ?>

4) Save and close the file.

5) Now open you’re web browser and type the following into the web address:

HTTP://LOCALHOST/TESTPHP.PHP

The page should look
.
.
.

Congrats you have now installed both Apache and PHP!

Install MySQL

To finish this guide up we will install MySQL. MySQL is a powerful database management system used for organizing and retrieving data

To install MySQL,

1) Open terminal and type in these commands

SUDO APT-GET INSTALL MYSQL-SERVER LIBAPACHE2-MOD-AUTH-MYSQL PHP5-MYSQL

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.

2) Once you have installed MySQL, we should activate it with this command

SUDO MYSQL_INSTALL_DB

3) Finish up by running the MySQL set up script

SUDO /USR/BIN/MYSQL_SECURE_INSTALLATION

4) The prompt will ask you for your current root password.

Type it in.

5) Enter current password for root (enter for none)

OK,

.

.

.

Add a Comment

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