Winp

Winp is an open-source (MIT) Nginx/PHP server for Windows

View project on GitHub

Winp: Windows Nginx PHP development server

Build Status License Download

image image

Overview

Winp is an open-source (MIT) Nginx/PHP server for Windows. It provides a one-click portable install of required software for PHP development:

Please note Winp is a development tool and is not suitable for production usage.

Installation

Download latest Winp release from GitHub or compile from source, unpack anywhere you want then run Winp.exe.

  • Click “Configure” button to change server bindings or locations (optional).
  • Click “Start services” button to download, configure and start packages.
  • Wait for a few minutes (on first start) and accept Windows network prompts.

You should see all packages in “Running” status (or “Ready” for phpMyAdmin which doesn’t execute as a background service). Click the “Open browser” button to have your default browser open to http://localhost/ or whatever URL you set as first location.

If you didn’t change default configuration you can also navigate to http://localhost/phpmyadmin/ to open PhpMyAdmin.

Configuration

In the configuration panel you can tweak how required packages are installed and run.

  • Install directory is the directory where all packages are downloaded. They’re all portable packages stored in their own directory, along with files they may create (e.g. logs, data files for MariaDB/MySQL).
  • Server address and Port can be changed to select which IP address and port Nginx will listen on.
  • Locations is a list of Nginx locations and how Nginx should process HTTP requests for each of them.

For each location you must specify a base URL (plain text only, no support for regexps yet) and a type that defines which configuration preset must be applied for this location. Available location types are:

  • No access (HTTP 403): reject all requests with HTTP 403 error.
  • Match PHP files by URL and execute: search for file matching relative URL path in root directory, execute it if it’s a PHP file or serve it otherwise.
  • Pass all requests to index.php: always execute index.php file from root directory.
  • Match file by URL or fallback to index.php: search for file matching relative URL path in root directory and serve that file, or fallback to executing index.php file from root directory.
  • Static files only: search for file matching relative URL path in root directory and service it (no PHP support).
  • Use PhpMyAdmin: execute PhpMyAdmin package.

For more advanced configuration, you’ll find *.template files created by Winp in package directories (e.g. nginx/$version/conf/nginx.conf.template). These files are used to produce actual configuration files each time services are started, so you can tweak them to your needs. They’re created if missing and reused otherwise, and are written using Cottle template engine with custom delimiters set to “{{”, “{|}” and “}}”.

Custom packages

You can replace the default versions for all packages by modifying the Winp.json file that gets created next to Winp.exe after you first save some configuration change within the application.

Locate the userVariants field for the package you want to customize and set it to any non-empty array to replace application defaults. Each item within this array is expected to contain the following fields:

  • downloadUrl is the full download URL of a ZIP version of the package
  • name is a human-readable software name identifier
  • pathInArchive is a relative path to package’s directory within archive (optional)
  • version is a human-readable software version identifier

Here is an example of user variant for Nginx:

{
    "downloadUrl": "https://nginx.org/download/nginx-1.27.3.zip",
    "name": "nginx",
    "pathInArchive": "nginx-1.27.3",
    "version": "1.27.3",
}

Credits

  • Freepik for the nice Elephant icon

Resource

  • Contact: v.github.com+winp [at] mirari [dot] fr
  • License: license.md