Skip to content

Install phlix-server on Windows โ€‹

TL;DR โ€‹

phlix-server is a PHP 8.3+ media server with HLS streaming, WebSocket real-time sync, DLNA, and a Smarty web portal. This guide installs it on Windows 10 21H2+ or Windows 11 in roughly 20 minutes.

Minimum requirements: Windows 10 21H2+ or Windows 11, 2 CPU / 4 GB RAM.

Quick one-liner (XAMPP): Download XAMPP โ†’ git clone โ†’ composer install โ†’ start Apache โ†’ open http://localhost:32400

Recommendation: Use WSL2 + Ubuntu for production. Use XAMPP for quick dev / non-Docker users.

Screenshots TBD

This guide is text-first. Screenshots will be added in a follow-up.


1. Choose your installation path โ€‹

Option 1: XAMPP (for dev / non-Docker users) โ€‹

  • Full stack: Apache + PHP + MariaDB bundled together
  • Easiest for users who don't want to touch WSL or containers
  • Download from apachefriends.org
  • Runs a real Ubuntu VM inside Windows
  • Native Linux experience: composer, apt, systemd scripts all work
  • Requires: Windows 10 21H2+ or Windows 11 with WSL2 enabled
  • See ยง3 for WSL2 setup steps

Option 3: IIS reverse-proxy to Workerman PHP โ€‹

  • For enterprise environments that already run IIS
  • Requires URL Rewrite module + ARR (Application Request Routing)
  • Advanced; less common

2. Option 1 โ€” XAMPP install โ€‹

2a. Download and install XAMPP โ€‹

  1. Download XAMPP PHP 8.3 from apachefriends.org
  2. Run the installer โ€” deselect unnecessary components (e.g., Tomcat)
  3. Install to default C:\xampp
  4. Start the XAMPP Control Panel

2b. Enable required PHP extensions โ€‹

Edit C:\xampp\php\php.ini and ensure these lines are uncommented (no ;):

ini
extension=curl
extension=gd
extension=mbstring
extension=mysql
extension=openssl
extension=zip
extension=xml
extension=bcmath

Save and restart Apache from the XAMPP Control Panel.

2c. Verify PHP version โ€‹

cmd
C:\xampp\php\php.exe -v

Expected: PHP 8.3.x

2d. Clone phlix-server โ€‹

cmd
git clone https://github.com/detain/phlix-server.git C:\phlix
cd C:\phlix

2e. PHP dependencies (Composer) โ€‹

cmd
C:\xampp\composer\composer.bat install --no-dev --optimize-autoloader

Or if Composer is installed globally:

cmd
composer install --no-dev --optimize-autoloader

2f. Configure environment โ€‹

cmd
copy .env.example .env

Edit .env:

env
APP_URL=http://localhost:32400
DB_HOST=localhost
DB_DATABASE=phlix
DB_USERNAME=phlix
DB_PASSWORD=your_strong_password

2g. Database setup (MariaDB via XAMPP) โ€‹

Open phpMyAdmin at http://localhost/phpmyadmin or run:

cmd
C:\xampp\mysql\bin\mysql.exe -u root -p
sql
CREATE DATABASE phlix CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'phlix'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON phlix.* TO 'phlix'@'localhost';
FLUSH PRIVILEGES;

2h. Run migrations โ€‹

cmd
php scripts/run-migrations.php

2i. Start the server โ€‹

cmd
php public\index.php

2j. Firewall configuration โ€‹

powershell
New-NetFirewallRule -DisplayName "Phlix HTTP" -Direction Inbound -Protocol TCP -LocalPort 32400 -Action Allow

Or via Windows Defender Firewall UI: Inbound Rule โ†’ New Rule โ†’ Port โ†’ 32400 โ†’ Allow.


3a. Enable WSL2 โ€‹

Open PowerShell as Administrator:

powershell
wsl --install --no-distribution

Restart the computer when prompted.

3b. Install Ubuntu โ€‹

powershell
wsl --install -d Ubuntu-24.04

Create a user account when prompted.

3c. Update Ubuntu โ€‹

bash
sudo apt update && sudo apt upgrade -y

3d. Install PHP 8.3 โ€‹

bash
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt install -y php8.3-fpm php8.3-mysql php8.3-curl php8.3-gd php8.3-zip php8.3-xml php8.3-mbstring php8.3-bcmath

3e. Install MariaDB โ€‹

bash
sudo apt install -y mariadb-server
sudo mysql_secure_installation

3f. Install FFmpeg โ€‹

bash
sudo apt install -y ffmpeg

3g. Install Composer โ€‹

bash
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

3h. Clone phlix-server โ€‹

bash
sudo mkdir -p /opt/phlix
sudo chown $USER:$USER /opt/phlix
git clone https://github.com/detain/phlix-server.git /opt/phlix
cd /opt/phlix

3i. PHP dependencies โ€‹

bash
composer install --no-dev --optimize-autoloader

3j. Configure environment โ€‹

bash
cp .env.example .env
nano .env

Set:

env
APP_URL=http://localhost:32400
DB_HOST=localhost
DB_DATABASE=phlix
DB_USERNAME=phlix
DB_PASSWORD=your_strong_password

3k. Database setup (MariaDB) โ€‹

bash
sudo mysql -u root -p
sql
CREATE DATABASE phlix CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'phlix'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON phlix.* TO 'phlix'@'localhost';
FLUSH PRIVILEGES;

3l. Run migrations โ€‹

bash
php scripts/run-migrations.php

3m. Start the server โ€‹

bash
php /opt/phlix/public/index.php

3n. Firewall configuration (from PowerShell on Windows host) โ€‹

powershell
New-NetFirewallRule -DisplayName "Phlix HTTP" -Direction Inbound -Protocol TCP -LocalPort 32400 -Action Allow

3o. Access from Windows browser โ€‹

Open http://localhost:32400 in your Windows browser.


4. Option 3 โ€” IIS reverse-proxy (advanced) โ€‹

4a. Install URL Rewrite and ARR โ€‹

Download and install URL Rewrite 2.1 from iis.net. Enable ARR (Application Request Routing) via IIS Manager โ†’ Server Farm.

4b. Create a site binding โ€‹

IIS Manager โ†’ Sites โ†’ Add Website:

  • Site name: phlix
  • Physical path: C:\phlix\public
  • Binding: Host: phlix.local, Port: 80

4c. Configure reverse-proxy โ€‹

In C:\phlix\public\web.config:

xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="ProxyToWorkerman" enabled="true" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{CACHE_URL}" pattern="^(https?)://" />
          </conditions>
          <action type="Rewrite" url="http://127.0.0.1:32400/{R:1}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

4d. Start Workerman โ€‹

cmd
php C:\phlix\public\index.php

5. Verify the install โ€‹

Open your browser:

http://localhost:32400

Expected: phlix-server index page loads (HTTP 200).


What can go wrong โ€‹

WSL2 not enabled or wrong version โ€‹

  • Symptom: wsl --install fails, or wsl -l -v shows Ubuntu with version 1
  • Fix: Enable Hyper-V and WSL2 via Windows Features, or run wsl --set-version Ubuntu-24.04 2 to migrate
  • Verify: wsl -l -v should show Ubuntu-24.04 with version 2

Hyper-V conflicts preventing WSL2 โ€‹

  • Symptom: WSL2 fails to start, or Ubuntu stuck at "Installing"
  • Fix: Ensure Windows is fully updated (21H2 or later); disable conflicting virtualization software (e.g., older VirtualBox)
  • Verify: systeminfo | findstr /C:"Hyper-V" should show Hyper-V present

PHP version mismatch โ€‹

  • Symptom: composer install fails with version errors, or runtime errors about missing PHP 8.3 features
  • Fix (XAMPP): Download PHP 8.3 version from apachefriends.org; uninstall old version first
  • Fix (WSL2): php -v should show 8.3; if not, sudo update-alternatives --config php or reinstall from ondrej/php PPA
  • Verify: php -v shows PHP 8.3.x

Missing Visual C++ Runtime โ€‹

  • Symptom: php.exe fails to start with "VCRUNTIME140.dll not found"
  • Fix: Download and install Visual C++ Redistributable 2015-2022 from Microsoft
  • Verify: php -v runs without error

Path separator issues (Windows vs Unix) โ€‹

  • Symptom: "File not found" errors, broken requires/includes
  • Fix: Ensure all paths in .env use Windows-style separators or that the app handles DIRECTORY_SEPARATOR correctly; avoid hardcoded / in file paths
  • Verify: Set git config --global core.autocrlf true to handle line endings

Port 32400 already in use โ€‹

  • Symptom: bind(): Address already in use
  • Fix: netstat -ano | findstr :32400 to find the conflicting process; stop it or change phlix port via APP_URL env var

XAMPP Apache won't start (port 80/443 conflict) โ€‹

  • Symptom: Apache shows "Error: Apache shutdown unexpectedly"
  • Fix: Check Skype, IIS, or another web server on ports 80/443; change XAMPP Apache ports in C:\xampp\apache\conf\httpd.conf (Listen 8080, 4433) and update virtual host config

Next steps โ€‹

BSD-3-Clause