PHP Get Started
NOTE:- Install WAMP Server or XAMPP or any other local server on your PC to quickly create web applications with Apache, PHP and a MySQL database.
What Do I Need Install local server ?
To get around the problem of a sync requests, we need to test such examples by running them through a local web server. One of the easiest ways to do this for our purposes is to use wamp or xampp or any local web server Simple HTTP Server module.
To start using PHP, you can install local server :
- Find a web host with PHP and MySQL support like example xampp or apache server
- Install a web server on your own PC, and then install PHP and MySQL
- If your server has active support for PHP you do not need to do anything.
Note :- The official PHP Group website (www.php.net) has installation more instructions for Click here ?
Creating Your First PHP Program
- Now that you have successfully installed apache server and php on your computer. In this section we will create a very simple PHP script that displays the text "Hello, world!" in the browser window.
- Now we have Create a subdirectory on inside root directory
- Now open your favorite code editor and create a new PHP file and save the name index.php and then type the following code:
//Syntax:- <?php ..............some code here .............. ?>
Now view the result in your browser through visiting this URL: http://localhost/directory name
//Example :- http://localhost/phpfirstprogram
PHP can be embedded within a HTML web page. That means inside your HTML document you can write the PHP statements, as demonstrated and screenshot in the following example: