Make sure your server is up-to-date with this guide.
The LAMP stack is a development stack that is common for PHP-based websites and web applications. LAMP stands for Linux, Apache, MySQL, PHP.
You will want to run the following command to install Apache:
apt-get install apache2 -y
Running this command with the -y option will automatically proceed through any parts of the installation that would prompt you for a yes/no answer.
Test your installation by opening a web browser and navigating to http://<Your_IP_Address>
Run this command to install MySQL. Once again, we are using the -y option:
apt-get install mysql-server -y
It is highly recommended to set the root password for MySQL after installation. You can use the following steps to change the password:
Start mysqld configuration:
mysqld --skip-grant-tables &
Make sure MySQL is running:
Log in to MySQL:
mysql -u root mysql
Change the root password:
UPDATE user SET authentication_string=password('YourPassword');
quit” to exit MySQL.
PHP is the server-side scripting language that gives your application or website the ability to interact with the server. To install PHP, run the following command:
apt-get install php libapache2-mod-php php-mbstring php-mysql -y
To verify the installation of PHP, you can check your version with this command: