Stackfizz PHP Server
Run PHP sites without installing a server. Open a PHP folder, click Start, and it's live at http://<folder>.localhost:8080. You don't need XAMPP, WAMP or an Apache setup, and there's no hosts file or PATH to edit and no admin rights needed. PHP, the web server and Composer download once and run inside VS Code.
Status: pre-release (0.1), Windows x64 only. macOS and Linux are planned for 0.2.
What you get
- PHP 8.5, kept current. PHP 8.5.13, the latest release with the fixes for the AI-found PHP2Shell and PHPAfterShell bugs, downloads the first time a site starts. The SHA-256 is checked, and you see the license before the download. A project that asks for an older PHP runs on 8.5, and the log says so.
- Several sites at once. Each project gets its own
*.localhost address, and one shared web server (Caddy) serves them all, also across VS Code windows.
- Live reload. Save a
.php, .twig, .js or .html file and the page reloads. Save a .css file and the styles swap in without a reload.
- No stale pages. Every response is sent with
Cache-Control: no-store, and PHP rechecks changed files on every request.
- Plain-language PHP settings. Site Settings opens a form for the PHP version, document root, domain, port, memory limit, upload size, form post size and time limit. Leave a field empty to keep the default.
- PHP and Composer in your terminal. New terminals get this project's
php, using its php.ini. Projects with a composer.json also get composer.
- Errors where you see them. A PHP fatal error shows a bar on the page with an Open log link. PHP errors and requests also appear in Stackfizz's log.
- Doctor checks for missing runtimes, a busy port (and which program holds it), the Visual C++ runtime and Windows Smart App Control.
- A PHP Sites view in the Stackfizz sidebar, with Start, Stop, Open, Clear cache and Settings for each site.
Laravel projects serve from public/ automatically. CMS projects and plain PHP projects serve from the project folder.
Getting started
- Install Stackfizz and this extension.
- Open your PHP project folder.
- Run Stackfizz: Start PHP Site from the Command Palette, or click Start in the PHP Sites view.
- Accept the one-time PHP and Caddy downloads (about 35 MB and 18 MB).
Your choices are saved in .stackfizz.json, which you can commit so your team gets the same setup. It holds a PHP version, document root, domain and port. It never holds passwords or program paths.
Requirements
- Windows 10 or 11, x64
- Visual Studio Code 1.105 or newer (also works in editors that use Open VSX)
- Stackfizz (installed automatically as a dependency)
- Microsoft Visual C++ 2015–2022 Redistributable (x64). Most PCs already have it; Doctor links to Microsoft's download if yours doesn't.
Known limits
- Smart App Control (Windows 11) only runs programs Windows recognises. Stackfizz uses the official PHP 8.5 build that Windows already knows, so PHP runs with Smart App Control on. If antivirus software or Windows still blocks it, Doctor explains what to check.
- Plain
.html files in a PHP site don't get live reload. Use Stackfizz's Live Server for static sites.
- PHP code calling its own
*.localhost address works through curl (used by WordPress, Guzzle and Laravel's HTTP client), but not through file_get_contents() or fsockopen().
- Symlinks: PHP can't open files outside the project (
open_basedir). Static files that are symlinked from outside the project are still served.
- Sites listen on
127.0.0.1 only, so other devices can't reach them. Other programs on this computer can, the same as with any local dev server.
Commands
Open the Command Palette and type Stackfizz. The PHP commands are Start PHP Site, Stop PHP Site, Open Site in Browser, Clear Cache (Restart PHP) and Site Settings.
Settings
| Setting |
Default |
What it does |
devstack.web.defaultPhp |
8.5 |
PHP version for projects whose .stackfizz.json doesn't set one |
devstack.web.port |
8080 |
Preferred port; if it's taken, the next free one is used |
devstack.web.memoryLimit |
256M |
PHP memory_limit |
devstack.web.uploadMaxFilesize |
64M |
PHP upload_max_filesize |
devstack.web.postMaxSize |
64M |
PHP post_max_size |
devstack.web.maxExecutionTime |
120 |
PHP max_execution_time, in seconds |
Privacy
This extension collects no data and sends nothing anywhere. It connects to the network only when you accept a runtime download. Stackfizz downloads the runtimes from php.net, GitHub (Caddy) and getcomposer.org.
Disclaimer
For local development only. Don't use it to run production servers. Provided "as is" under the MIT license. PHP, Caddy and Composer are separate projects under their own licenses. This extension isn't affiliated with any of them. XAMPP, WampServer, Apache and other names are trademarks of their owners, mentioned only to describe what you don't need to install; this extension isn't affiliated with or endorsed by them.
License
MIT
| |