PHP built in server

Robert Isoski edited this page Dec 8, 2018 · 4 revisions

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

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.