Skip to content
Nibiru docsv0.9.2

Installation

Clone Nibiru, install dependencies, set permissions, run your first migration.

Stable Reading time ~ 2 min Edit on GitHub
  • PHP ≥ 8.2 with these extensions: pdo, gd, memcached, curl.
  • Composer for PHP dependencies.
  • A database: MariaDB / MySQL ≥ 10.4, or PostgreSQL ≥ 13. ODBC if you’re connecting to a non-native source.
  • Smarty (installed via Composer).
  • A web server with mod_rewrite (Apache) or equivalent (vhost.conf is included for nginx-style docroots).
Terminal window
git clone https://github.com/alllinux/Nibiru my-app
cd my-app
composer install

Composer installs into core/l/ (Nibiru uses an unusual vendor-dir to keep all framework code under core/).

Copy the example INI file and edit your environment:

Terminal window
cp application/settings/config/settings.development.ini.example \
application/settings/config/settings.development.ini

The minimum sections you need to set:

[ENGINE]
templates = "/../../application/view/templates/"
templates_c = "/../../application/view/templates_c/"
cache = "/../../application/view/cache/"
caching = false
debug = true
error.controller = "error"
[SETTINGS]
page.url = "https://my-app.local"
navigation = "/../../application/settings/config/navigation/main.json"
modules.path = "/../../application/module/"
entries.per.page = 25
smarty.css[] = "/public/css/app.css"
smarty.js[] = "/public/js/app.js"
timezone = "Europe/Vienna"
[DATABASE]
driver = "pdo" ; one of: mysql, pdo, postgres, psql, postgresql
hostname = "localhost"
port = 3306
username = "nibiru"
password = "secret"
basename = "nibiru_dev"
encoding = "utf8mb4"
is.active = true
[SECURITY]
password_hash = "change-me-at-once"
[GENERATOR]
database = true ; auto-generate models from DB tables

APPLICATION_ENV selects which file is loaded — settings.development.ini by default.

Terminal window
export APPLICATION_ENV=production # picks settings.production.ini
Terminal window
./nibiru -s

This creates / fixes permissions on application/view/templates_c/, application/view/cache/, log directories, etc.

Migration files live in application/settings/config/database/ as numbered SQL files (001-acl.sql, 002-account.sql, …). Run them all with:

Terminal window
./nibiru -mi local

The migrator records what it has applied so re-running is safe. To apply against staging or production, change the environment:

Terminal window
APPLICATION_ENV=production ./nibiru -mi production

Point your web server’s docroot at the project root (the directory that contains index.php). For nginx, use the included vhost.conf as a starting point. For Apache, the default .htaccess route rewrite into index.php is sufficient.

Browse to / and you should see the index template. From there, the Quick Start walks you through your first controller and view.