4 PHP built in server
Robert Isoski edited this page 2018-12-08 20:06:26 +01:00

Add support for PHP built in server

This gives a nice and quick way of getting started locally.

How to

Add a file called router.php:

<?php

if(pathinfo($_SERVER["REQUEST_URI"], PATHINFO_EXTENSION)) {
    // asset file; serve from filesystem
    return false;   
} else {
    $_GET['page'] = parse_url($_SERVER["REQUEST_URI"])['path'];
    include 'index.php';
}

And run: php -S localhost:8090 router.php

For proper logout: Modify 'logout&token=' to 'logout?token=' in the index.php (Warning: this step has to be repeated each time WonderCMS is updated).


NOTE: This is not official functionality from WonderCMS and is intended for local use only.

Credits for tutorial: @jellehak