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!";
?>
What are the uses of PHP?
PHP is used to create dynamic web pages, manage sessions, handle forms, connect to databases, send emails, build APIs, and more.
What is the history of PHP?
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.
How to set up the PHP environment?
You can set up PHP using software bundles like:
- XAMPP (Windows/Linux)
- WAMP (Windows)
- LAMP (Linux)
- MAMP (Mac)
Steps:
- Download and install XAMPP
- Place your
.php
files in thehtdocs
folder - Start Apache server from the XAMPP control panel
- Open browser and navigate to:
http://localhost/yourfile.php
What is the PHP file and extension?
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.";
?>