Course Content
About Lesson

What is PHP?

PHP stands for “PHP: Hypertext Preprocessor”. It is a widely-used, open-source server-side scripting language especially suited for web development.
Example:

PHP
<?php
  echo "Hello, World!";
?>

PHP is used to create dynamic web pages, manage sessions, handle forms, connect to databases, send emails, build APIs, and more.

PHP was created by Rasmus Lerdorf in 1994. It started as a set of Common Gateway Interface (CGI) binaries written in the C programming language.

You can set up PHP using software bundles like:

  • XAMPP (Windows/Linux)
  • WAMP (Windows)
  • LAMP (Linux)
  • MAMP (Mac)

Steps:

  1. Download and install XAMPP
  2. Place your .php files in the htdocs folder
  3. Start Apache server from the XAMPP control panel
  4. Open browser and navigate to: http://localhost/yourfile.php

PHP files have the .php extension and contain code inside <?php ?> tags.

PHP
<?php
  // This is a PHP file
  echo "This is my first PHP page.";
?>