iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

PHP Install

You don't need to install anything to follow this tutorial — the in-browser editor runs PHP via WebAssembly. For real projects, install PHP locally.

The easy way — all-in-one stacks

ToolOSWhat you get
XAMPPWindows / macOS / LinuxApache, PHP, MySQL, phpMyAdmin in one installer.
LaragonWindowsLighter than XAMPP, with one-click projects.
HerdmacOS / WindowsModern, fast, Laravel-friendly.
MAMPmacOS / WindowsLong-standing local stack.
DDEV / DockerAnyReproducible per-project containers.

Verify the install

SHELL
php -v
# PHP 8.x.x (cli) ...

php -m
# Shows enabled extensions

php -S localhost:8000
# Built-in web server for quick demos

Your first script

PHP — hello.php
<?php
echo 'Hello, world!';
echo PHP_EOL, 'Running PHP ', PHP_VERSION;
SHELL
$ php hello.php
Hello, world!
Running PHP 8.3.0

Editor choices

  • VS Code + the PHP Intelephense extension — most popular setup.
  • PhpStorm — JetBrains' PHP IDE; rich refactoring and Laravel/Symfony tooling.
  • Anything with syntax highlighting + a terminal works.
Tip: Install Composer right after PHP — it's the package manager and you'll need it for any non-trivial project.

Example

Example
<?php
// XAMPP / Laragon / Herd give you Apache + PHP + MySQL.
// php -v   shows your installed version.
echo phpversion();
Try it Yourself »

Exercise

Show installed PHP version on the command line.

php

Test yourself

Q1. XAMPP bundles…
Q2. Show the installed PHP version with…
Q3. Start the built-in PHP web server with…

Discussion

Loading…