PHP Install

Run PHP on your computer with XAMPP.

✍️ 2 exercises in this lesson

To run PHP locally you need a web server with PHP. The easiest option on Windows is XAMPP (Apache + MySQL + PHP).

  1. Download and install XAMPP from apachefriends.org.
  2. Open the XAMPP Control Panel and start Apache (and MySQL if you need a database).
  3. Save your file in C:\xampp\htdocs\, e.g. C:\xampp\htdocs\hello.php.
  4. Open http://localhost/hello.php in your browser.

You can also run PHP from the terminal: php hello.php, or start a built-in server with php -S localhost:8000.

Key Takeaways: PHP Install

Mastering PHP Install helps you write clean and reliable PHP code. Follow standard conventions, test edge cases, and keep logic simple. Try running the code example below and complete the exercises to build confidence.

PHP Install Code Example

PHP
<?php
echo "PHP version: " . phpversion();
Output
PHP version: 8.2.12
Run this example on your own computer. The "Get Started" lesson shows how to set it up.

PHP Install Practice Exercises

Check what you learned in “PHP Install”.

/ 2 solved
Fill in the blank

Start PHP's built-in development server on port 8000.

php  localhost:8000
✓ Correct! Not quite. Try again.
Multiple choice

In XAMPP, which folder holds your web files?

✓ Correct! Not quite. Try again.
to save your exercise progress.
Finished this lesson?
Mark it complete to track your progress.

Stuck on something?

Ask the community in the CodesInTech forum.

Need a developer?

Learning on your own is great — and when you need professional help, our team builds custom software, websites and mobile apps for clients worldwide.

Explore Our Services