Hello
I wanted to test the Flarium software on my own computer, without running a complete LAMP suite, by using the PHP built-in server. I ran into a few troubles to do that, and there wasn't any documentation on this subject—that's why I'm writing the few steps here.
Warning: the PHP built-in development server should not be used in production! Only for testing purposes.
The beginning of the installation is the one well-documented here. You can follow it through the end without any trouble, as long as you have all the required dependencies, of course.
Then, if you try to simply launch your forum using the PHP built-in server:
$ php -S 0.0.0.0:8888
...the web installer will work and the home page will be displayed successfully, but any other action will fail (and the admin area will not be accessible). This because the built-in server doesn't understand the Apache redirection rules.
To fix that, you'll have to give the PHP web server a router, basically reimplementing the rewrite rules in plain PHP. Here it is, so you don't have to write this yourself. I created a file named router.php
located next to index.php
, but you should be able to place it elsewhere, as long as you don't mess with the imports.
<?php
if (strpos($_SERVER['REQUEST_URI'], '/asset') === 0)
{
return false;
}
else if (strpos($_SERVER['REQUEST_URI'], '/admin') === 0)
{
include __DIR__ . '/admin.php';
}
else if (strpos($_SERVER['REQUEST_URI'], '/api') === 0)
{
include __DIR__ . '/api.php';
}
else
{
include __DIR__ . '/index.php';
}
Then launch your server using:
$ php -S 0.0.0.0:8888 router.php
and all the Flarium installation works properly, without Apache—better on a locale machine, for some people.
Hope this can help!