About Lesson
Installing PHP (Options):
We can use php language using Multiple Options:
Option A: XAMPP (Windows/Mac/Linux)
- Install XAMPP.
- In the XAMPP Control Panel, start Apache.
- The project folder is located at: XAMPP/htdocs/
- Inside the htdocs folder, create a new folder named php-basics/ and place your project files inside it.
- Example:
C:/xampp/htdocs/php-basics/hello.php
Option B: WAMP (Windows)
- Install WAMP → Start Apache.
- Project folder:
C:\wamp64\www\php-basics\
Option C: Laragon (Windows)
- Install Laragon → Start Apache/Nginx.
- Project folder:
C:\laragon\www\php-basics\
- Browser:
http://localhost/php-basics/
- (Laragon can also create an auto virtual host, e.g.
http://php-basics.test
)
Option D: VS Code + PHP CLI (Built-in Server)
- Install PHP
Windows: download zip/exe
Mac: use Homebrew
Linux: use package manager (apt
,yum
, etc.) - Check installation in terminal:
php -v
- Go to your project folder and run:
php -S localhost:8000
- Open in browser:
http://localhost:8000