Phive is a professional Visual Studio Code extension designed to streamline PHP development by providing a modern, live-reloading environment. It eliminates the need for manual browser refreshes and complex server configurations, making it ideal for both local and cross-device testing.
- Instant PHP Server: Launch a built-in PHP server instance directly from your workspace with a single click.
- Smart Live Reloading: Automatically refreshes connected browsers (desktop and mobile) upon saving
.php,.html,.css,.js, or.jsonfiles. - Port Conflict Resolution: Automatically detects if port 8000 or the WebSocket port is occupied by another application and switches to the next available port, preventing environment crashes.
- Network Sharing: Automatically detects your local IPv4 address, allowing seamless testing on mobile devices or tablets connected to the same network.
- Integrated Request Logging: Real-time output channel providing detailed logs of incoming HTTP requests and server status.
- Multi-root Workspace Support: Intelligent folder selection for developers working on multiple projects simultaneously.
- Customizable PHP Path: Support for custom PHP binary locations, ensuring compatibility with XAMPP, WAMP, Laragon, or standalone PHP installations.
- Automated Routing: Generates a temporary, hidden router script to handle asset serving and WebSocket injection without polluting your project structure.
- PHP: PHP must be installed on your system.
- Environment: By default, the extension expects the
phpexecutable to be in your system's PATH.
- Open Visual Studio Code.
- Navigate to the Extensions view (
Ctrl+Shift+X). - Search for
Phiveand click Install.
Phive provides the following configuration options through VS Code Settings (Ctrl+,):
-
phive.phpPath: Specifies the absolute path to the PHP executable. Set this ifphpis not in your system PATH (e.g.,C:\xampp\php\php.exeon Windows). -
phive.port: Specifies the preferred local port for the PHP server instance (Default:8000). Ideal for restrictive local network environments or static proxy routing rules.
- Start the Server: Open a PHP project folder. Click the Phive: Go Live button in the Status Bar (bottom right) or use the Command Palette (
Ctrl+Shift+P->Phive: Start PHP Server). - Select Folder: If using a multi-root workspace, select the specific project folder you wish to serve.
- Development: The extension will automatically open your default browser. Any changes saved to supported files will trigger an immediate reload across all connected devices.
- Stop the Server: Click the active server info in the Status Bar or use the
Phive: Stop PHP Servercommand.
Phive utilizes a WebSocket-based architecture (ws library) to maintain a persistent connection between the server and the client. During execution, it injects a lightweight JavaScript client into the PHP output stream via a temporary router file (.phive_router.php). This router file is automatically hidden from the VS Code File Explorer and securely deleted upon server termination to maintain workspace cleanliness.
Contributions must comply with the official project guidelines. Please read the CONTRIBUTING.md file before submitting any code, issues, or pull requests.
This project is licensed under the FomaDev Public License (FPL). Commercial distribution, redistribution of modified source code, or hosting derivative services based on this engine requires a explicit paid license. See the LICENSE file for full legal terms and conditions.
Developed by FomaDev