How to setup an Apache web server for PHP?

What are the steps of commands to setup an Apache web server for PHP latest version.

To setup an Apache web server, you need to run the below commands step by step and you will get the server ready to execute PHP and host any website developed in PHP. This is not a very difficult to make ready the server just you need to focus on what you are doing. Get start doing practice and it will become usual approach and many additional things you will know about setting up the web servers by doing research over google or any other search engines.

 

sudo apt-get update


sudo apt-get install apache2


sudo apt-get install mysql-server


sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql


sudo systemctl restart apache2


apt-get install phpmyadmin


service apache2 restart


sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf


sudo a2enconf phpmyadmin.conf


sudo service apache2 reload


service apache2 restart

These are the commands you need to execute one by one and your web server is ready. Use it and let me know if you face any difficulty in this process.