How to install LAMP on CentOS server

LAMP is acronym refers to a Linux-based operating system (Linux + Apache + MySQL + PHP) this is a popular open source web platform stack for Linux. LAMP stack is a commonly used to run dynamic web sites and servers. The main components are GNU/Linux operating system, the Apache HTTP Server, the MySQL relational database management system, and the PHP programming language. In some different installs it includes Linux, Apache2+, MariaDB (MySQL drop-in replacement) and PHP/Python/Perl.

Installing the basic components is pretty simple, just access your server via SSH console and run the following commands:

# yum install httpd
# yum install php
# yum install mysql-server mysql
# service httpd start
# service mysqld start

To check if the setup was successful, access your VPS or dedicated server by IP: http://80.79.***.*** (your server’s IP address) in a browser. You should see a default Apache page. You can test PHP by creating a file manually in /var/www/html:

# vi /var/www/html/test.php

To see how PHP is going well place the following content in php wrap-brackets to test.php:

php phpinfo();

Now access http://80.79.***.***/test.php in your browser. If you see PHPINFO output (information about your PHP installation) displayed without any errors, you have done everything right!

Looking for a custom solution?

Our technicians can provide you with the best custom made solutions on the market, no matter whether you're a small business or large enterprise.

Get in touch