Skip to content
Justice Tech School

PHP Install and Run

Install PHP from php.net or with XAMPP, Laragon or Docker. Run a file with php file.php, or start a local web server with php -S localhost:8000.

Example
<?php
echo "Hello World";

// Terminal:
//   php hello.php
//   php -S localhost:8000

Exercise

Start a local server.

php  localhost:8000

Quiz Test

Which command runs a PHP file?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.