Before we create the first program or dynamic web pages or websites in PHP. We should know about the local web server. Because we knew that PHP is server side scripting language. It will be code executes on a web server. Also, we should have a basic knowledge of HTML and CSS.
Basically PHP script executes on a web server. So before you start writing any PHP program we need about the local web server.
The PHP Community Provides Some types of the local web server. These are the following:
One of the above web servers must be installed on our computer. When we start learning PHP or creating the first program in PHP, a web server is installed on your system.
All these local web servers having PHP, MySQL, Apache and operating system base configuration file, it doesn't need to configure manually.
|Web Server||Stands for|
|WAMP||Microsoft window o/s, Apache Mysql PHP. Click here to download and install WAMP Server|
|LAMP||Linux Operating System Apache Mysql PHP. Click here to download and install LAMP Server|
|MAMP||Mac os Apache Mysql PHP. Click here to download and install MAMP Server|
|XAMPP||x-os(cross operating system) Apache Mysql PHP Perl. Click here to download and install XAMPP Server|
Above give web servers, If you have successfully installed any one web Server on your computer. Go to your web server directory, where you have installed web server on your computer system. Like C:\xampp\htdocs\ or C:\wamp\www and we create a very simple PHP script that displays the text "Hello, Developers" in the browser window.
If you have installed xampp, you need go C:\xampp\htdocs\
If you have installed wamp, you need go C:\wamp\www
First of all, create your project folder where you have installed your web server and then inside the project folder, You will create a simple PHP file with any name you want to.
Next,open up your favorite code editor and create a new PHP file then type the following code:
<?php // Display greeting message echo "Hello, world!"; ?>
Now save this file in your project folder (located at C:\xampp or wamp \www\project), and view the result in your browser through visiting this URL: http://localhost/project/filename.php.