Skip to content
Learn Netverks

Lesson

Step 2/36 6% through track

what-is-php

What is PHP?

Last reviewed May 28, 2026 Content v20260528
Track mode
server_script
Means
Server runner
Reading
~2 min
Level
beginner

This lesson

This lesson teaches What is PHP?: the syntax, APIs, and habits you need before advancing in PHP.

Teams ship What is PHP? on every PHP codebase—skipping it leaves gaps in debugging and code reviews.

You will apply What is PHP? in contexts like: LAMP/LEMP stacks, Laravel apps, WordPress themes/plugins, and shared hosting.

Write PHP in the editor and click Run on server—the dev runner executes your script and returns stdout/stderr (set LEARNING_RUNNER_ENABLED=true locally).

After HTML fundamentals and basic programming concepts—before or alongside SQL.

PHP is a general-purpose scripting language with first-class web support. It powers WordPress, Laravel, Symfony, Drupal, and a large share of hosted websites—especially on shared LAMP/LEMP hosting where deploy is upload-and-go.

Core characteristics

  • Interpreted at request time — the server reads .php files and executes them per request (with opcode caches like OPcache in production)
  • Embeds in HTML — or, in modern apps, returns JSON from API routes
  • Large standard library — strings, arrays, file I/O, HTTP, PDO, sessions built in
  • Package ecosystem — Composer and Packagist for reusable libraries

Typical request flow

  1. Browser requests /products.php?id=5
  2. Web server (Apache/Nginx) hands the script to PHP
  3. PHP reads $_GET['id'], queries the database, builds HTML
  4. Response travels back to the browser

Important interview questions and answers

  1. Q: Is PHP compiled or interpreted?
    A: Source is interpreted per request, though OPcache stores compiled bytecode in memory for speed—think "interpreted with caching," not ahead-of-time compilation like Go.
  2. Q: What is PHP mainly used for?
    A: Server-side web development—dynamic pages, REST APIs, CMS themes/plugins, and full frameworks like Laravel.
  3. Q: Is PHP still relevant?
    A: Yes—massive existing codebase, WordPress/Laravel hiring demand, cheap hosting, and steady language improvements (typed properties, enums, fibers, JIT in some workloads).

Self-check

  1. Name two products or frameworks built on PHP.
  2. What file extension do PHP scripts typically use?

Interview prep

What powers WordPress and Laravel?

Both are built on PHP—WordPress as a CMS platform and Laravel as a modern full-stack framework with routing, ORM, and ecosystem tooling.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • Interpreter vs compiled?
  • What is PHP-FPM?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump