For those familiar with Laravel, it has this nitfy ability to run the application with the PHP built-in server. If your (local) development machine has PHP installed you can already run Laravel. The "only" thing you need for this is a little proxy script that redirects calls to the php files, eg the nginx/apache rewrite rules.
I've written a small script to allow the same behavior for Flarum. Simply create a php file in your Flarum root directory called server.php
and add the following contents:
<?php
$uri = urldecode(
parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);
if (preg_match('/^\/api/', $uri)) {
require_once __DIR__ . '/api.php';
}
elseif (preg_match('/^\/admin/', $uri)) {
require_once __DIR__ . '/admin.php';
}
elseif ($uri !== '/' && file_exists(__DIR__.$uri)) {
return false;
} else {
require_once __DIR__ . '/index.php';
}
Now simply run using php -S localhost:8000 server.php
, open your browser at http://localhost:8000 and make sure your config reads that url too and you're set.
Please understand this is for development only and you still have to get a MySQL database available.