What is PHP and where it runs
| What is PHP | |
| Where PHP runs | |
| Why learn PHP 8.5 | |
| Check your setup |
What is PHP
PHP is a server-side scripting language built for the web. A visitor requests a page, PHP code runs on the server, and the server sends back plain HTML.
Unlike scripts in the browser, PHP never runs on the visitor's computer in a normal setup. It runs where your site lives: on the server.
$message = "Hello from the server!"; echo $message;
Where PHP runs
The same language runs in three places. Behind a web server it builds pages and APIs. In the terminal it runs scripts, tests, and maintenance jobs.
On your own machine the built-in web server is enough for learning. You will meet it in the next lesson.
echo PHP_SAPI; // cli or fpm-fcgi echo PHP_VERSION; // for example 8.5.0
Why learn PHP 8.5
Modern PHP is strict, fast, and typed. Each PHP 8 release added real types, faster execution, and cleaner syntax, and the full story lives in PHP versions.
Millions of sites run on PHP, from small blogs to large shops, so the first job or freelance order is never far away. Hosting, frameworks, and packages are everywhere.
function total(float $price, int $qty): float { return $price * $qty; } var_dump(total(9.5, 4)); // float(38)
Check your setup
You need two things for the next lesson: PHP 8.1 or newer and a terminal. Any code editor works, even a plain one without plugins.
if (version_compare(PHP_VERSION, "8.1.0", ">=")) { echo "Ready for the course!"; }
Next: Install PHP 8.5 and run your first command
Article author: Arthur Isaev