Skip to content

Install

Install the liqx extension, upload Sworen, configure your web server and run the setup wizard.

Sworen renders its storefront with liqx, a compiled PHP extension. It also carries the license check, so the store does not run without it.

Pick the right file. Releases are named liqx-php<PHP version>-<CPU>-<libc>.so. Find the three parts on your server:

php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;'
uname -m
ldd --version 2>&1 | head -1
  • PHP version: 8.4 gives php8.4.
  • CPU: x86_64 gives x86_64; aarch64 or arm64 gives aarch64.
  • libc: if the last line mentions musl, use musl; otherwise gnu.

A typical Ubuntu server with PHP 8.4 needs liqx-php8.4-x86_64-gnu.so. Check it against SHA256SUMS from the same release:

sha256sum -c SHA256SUMS --ignore-missing

On Alpine (musl), install libgcc first: apk add libgcc.

Load it for every PHP that runs Sworen, the command line and PHP-FPM (they often read different php.ini files):

EXT_DIR=$(php -r 'echo ini_get("extension_dir");')
sudo cp liqx-php8.4-x86_64-gnu.so "$EXT_DIR/liqx.so"
# Debian/Ubuntu:
echo "extension=liqx.so" | sudo tee /etc/php/8.4/mods-available/liqx.ini
sudo phpenmod liqx
sudo systemctl restart php8.4-fpm
# Elsewhere: add extension=liqx.so to each php.ini that `php --ini` lists.

Check it: php -m | grep liqx prints liqx.

Unzip the release in the directory you will serve from (/var/www/sworen below). It already contains everything it needs: no composer or npm on the server. The web server’s PHP user must own it, because the installer writes its configuration and the store writes uploads:

sudo unzip sworen-*.zip -d /var/www && sudo chown -R www-data:www-data /var/www/sworen

With MySQL or MariaDB, create a user for the store. The installer can create the database itself:

CREATE USER 'sworen'@'localhost' IDENTIFIED BY '<a strong password>';
GRANT ALL PRIVILEGES ON `sworen`.* TO 'sworen'@'localhost';

Serve public/ and send every request that isn’t a file to public/index.php. With nginx and PHP-FPM:

server {
server_name shop.example.ma www.shop.example.ma;
root /var/www/sworen/public;
index index.php;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
}
}

Add HTTPS, for example with certbot --nginx.

Open your domain in a browser. A fresh copy sends every page to /install:

  1. Setup key: proves you own the server. Read it with cat /var/www/sworen/var/install.key.
  2. Requirements: PHP extensions, the liqx extension, writable folders and the license server. Anything red says how to fix it.
  3. Database: MySQL/MariaDB (name, user, password, host, port) or SQLite. Tested before you continue.
  4. Cache and mail: files or Redis, and an SMTP server for email (or none yet). Both tested.
  5. Store: store name, address (the domain your license is for), currency, your admin email and password, an optional license key, and an optional demo catalog.

The wizard creates the tables, the store and your account, and starts the free trial (or activates your key). After that, /install is gone. Your admin is at /admin.

The same installer runs without a browser:

sudo -u www-data php bin/obelisk install --url=https://shop.example.ma --store-name="My Shop" \
--owner-email=me@example.ma --db-user=sworen --db-password=… [--demo]

Next: set up the scheduled tasks.