Skip to content

Howto PhpEmbeddedServer

mikespub edited this page Oct 16, 2024 · 3 revisions

How to use COPS with PHP Embedded Server

For use in a small local network, you won't need a heavy webserver like nginx. The built-in webserver in PHP should be enough.

$ cd cops
$ ln -s "~/Calibre Library" library
$ cat config/local.php
<?php
    if (!isset($config))
        $config = array();
    $config['calibre_directory'] = './library/';
    $config['cops_title_default'] = "COPS";
    $config['cops_use_url_rewriting'] = "0";

To use the built-in webserver with COPS 3.x, you need to specify a router script:

$ php -S 192.168.0.3:8080 router.php

Note that storing your Calibre library inside COPS'directory is a bad idea for security so this should only be done on a safe LAN.

Thanks to progandy for the idea.