PHP: Running Code & Tools
Running PHP scripts
php file.php # run a script (output goes to stdout)
php -S localhost:8000 # built-in development server
The built-in server is great for local testing. It serves files from the current directory on port 8000.
Editors / IDEs
- PhpStorm — JetBrains IDE for PHP (the most popular, paid)
- VS Code — install PHP IntelliSense extension (by Damien Wager) or PHP by DEVSENSE
- Vim/Neovim with intelephense LSP server
- Laravel Idea — plugin for PhpStorm if you use Laravel
Composer (package manager)
composer require laravel/framework # install a package
composer install # install from composer.json
composer update # update all deps
composer dump-autoload # regenerate autoload files
Composer is PHP's dependency manager. It's the equivalent of npm, pip, or cargo.
Local development environments
- XAMPP — Apache + MySQL + PHP + phpMyAdmin, all-in-one installer
- Laragon — modern Windows PHP dev environment with Nginx/Apache toggle
- Docker — official PHP images (
php:8.2-apache,php:8.2-fpm) - Valet — macOS-only, lightweight for Laravel
Frameworks (most popular)
| Framework | Use Case |
|---|---|
| Laravel | Full-featured, most popular |
| Symfony | Enterprise, modular components |
| CodeIgniter | Lightweight, simple |
| WordPress | CMS / blogging (not a framework per se, but powers 40% of the web) |
Quick check below!