There are many ways to install PHP on your computer machine.
Install PHP through Xampp software
Xampp is a Windows,MacOs and Linux web development environment. It is the most famous in the market. when you install this software then many software is installed automatically like PHP, Apache, MariaDB, and Perl.
kindly go to the below URL to install the package
Install PHP through Wamp software
WampServer is a Windows web development environment. It allows you to create web applications with Apache2, PHP, and MySQL. You can download it through the below link.
Install package one by one separately
Install packages through a command in Linux.
sudo apt update sudo apt install apache2
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
sudo apt-get install mysql-server
You can try the code on the editor.
<!DOCTYPE html> <html> <head> <title>PHP Editor</title> </head> <body> <h1>Welcome PHP Editor</h1> <?php $msg='PHP code must be write into php tag and click on the "Run" button to view the result.'; echo $msg; ?> </body> </html>