Skip to content

Chapter 1 of 38

Introduction to PHP

Explore PHP history, request execution, server integration, and its web role.

26 minutes 10 quick checksBy Subha Prasad
Lesson 1 of 38Course navigation

Lesson content

Read, practise, then check your understanding

Rasmus Lerdorf began PHP in 1994; it evolved into a general-purpose language maintained by a large open-source community. PHP commonly runs behind Apache or Nginx through PHP-FPM, executes one request, and returns HTML, JSON, files, or redirects.

Practical example

<?php
declare(strict_types=1);
$name = 'PHP';
echo "Hello, $name!";

PHP supports dynamic values, modern type declarations, OOP, exceptions, streams, database extensions, and Composer packages. Request-local memory is temporary; durable state belongs in databases, sessions, caches, queues, or files. Server-side execution hides source but does not make input, SQL, output, or secrets safe.

Knowledge check

Answer every question correctly to complete this chapter.

Which statement best describes PHP?
Which PHP term matches this description: A server-side language commonly used to generate web responses.
Which statement best describes PHP interpreter?
Which PHP term matches this description: The runtime that parses and executes PHP source.
Which statement best describes PHP-FPM?
Which PHP term matches this description: A FastCGI process manager commonly connected to a web server.
Which statement best describes request lifecycle?
Which PHP term matches this description: Per-request bootstrap, execution, response, and cleanup.
Which statement best describes Composer?
Which PHP term matches this description: PHP's dependency manager and package autoloader ecosystem.

0 of 10 checks passed

Your progress is saved on this device.

Introduction to PHP | PHP Lesson | Subha Prasad