PHP

PHP is an acronym for “PHP: Hypertext Preprocessor”.PHP is a widely-used, open source scripting language.PHP scripts are executed on the server

 

PHP File

  • PHP files can contain text, HTML, CSS, JavaScript, and PHP code
  • The PHP code is executed on the server, and the result is returned to the browser as plain HTML
  • PHP files have an extension “.php”

 

PHP File Example

<!DOCTYPE html>

<html>

<body>

<?php

echo “First Test!”;

?></body>

</html>

PHP Compatible

  • PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
  • PHP supports a wide range of databases
  • PHP is free. Download it from the official PHP resource: www.php.net
  • PHP is easy to learn and runs efficiently on the server side

 

How to Setup Web Server with localhost

Purchase domain name and hosting name.Examples Godaddy, Alicloud etc.

In Hosting, we have to install

For windows

  1. Apache
  2. Php
  3. Phpmyadmin  
  4. xampp
  5. or install wamp Download Link

For Mac

  1. Mamp
  2. Install Mamp Download Link

How to give path to folders

For Mac

  1. Open htdocs folder
  2. Create the folder with any name example, Directory
  3. In the Directory create an index.php file
  4. On the server in mamp
  5. Click on website option and folder appear on the screen.
  6. Click on directory folder which we created in the starting.
  7. After this, the website appears on the screen
  8. Congratulations, It is done

For Window

  1. Open wamp
  2. Open www folder
  3. Write code in an index.php file
  4. Open Browser
  5. Type localhost in the address bar
  6. After this, the website appears on the screen
  7. Congratulations, It is done.