Search

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 :

  1. Find a web host with PHP and MySQL support like example xampp or apache server
  2. Install a web server on your own PC, and then install PHP and MySQL
  3. 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

  1. 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.
  2. Now we have Create a subdirectory on inside root directory
  3. 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:

Stack Overlode is optimized Tutorials and examples for learning and training. Examples might be simplified to improve reading and learning and understand. Tutorials and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using Stack Overlode, you agree to have read and accepted our terms of use, cookie and privacy policy.